---
title: Queries with curl/http requests
pubDate: 2026-08-17T09:53:44.266Z
antora:
  editUrl: https://github.com/couchbase/docs-server/edit/release/7.2/modules/fts/pages/fts-creating-with-curl-http-requests.adoc
  xref: xref:7.2@server:fts:fts-creating-with-curl-http-requests.adoc[]
---

[Consult the llms.txt file for a full list of contents](/llms.txt)
[View original HTML](/server/7.2/fts/fts-creating-with-curl-http-requests.html)

# Queries with curl/http requests

> Couchbase Full Text Search supports running multiple types of queries through curl/http request. 

## [](#term-query)Term Query

The below sample responds with a list of documents in which the field _type_ contains the term **airline**.

> [!NOTE]
> The query works only for the terms with single word.

### [](#curl-request)Curl Request

```JSON
curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d
'{
	"query": {
		"term": "giverny",
		"field": "title"
	}
}'
```

### [](#curl-response)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "term":"giverny",
      "field":"title"
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_10064",
      "score":10.033205341869529,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_10063",
      "score":10.033205341869529,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
  "total_hits":2,
  "max_score":10.033205341869529,
  "took":219177695,
  "facets":null
}

## [](#phrase-query)Phrase query

The below sample responds with a list of documents in which the field _title_ contains specified phrase. For example, **Glossop** or **Giverny**.

### [](#curl-request-2)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d
'{
	"query": {
		"terms": ["glencoe", "youth", "hostel"],
		"field": "name"
	}
}'

### [](#curl-response-2)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "terms":["glencoe","youth","hostel"],
      "field":"name"
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_10142",
      "score":8.77552218572323,
      "locations":{
        "name":{
          "glencoe":[
            {
              "pos":1,
              "start":0,
              "end":7,
              "array_positions":null
            }
          ],
          "hostel":[
            {
              "pos":3,
              "start":14,
              "end":20,
              "array_positions":null
            }
          ],
          "youth":[
            {
              "pos":2,
              "start":8,
              "end":13,
              "array_positions":null
            }
          ]
        }
      },
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
  "total_hits":1,
  "max_score":8.77552218572323,
  "took":199844879,
  "facets":null
}

## [](#match-query)Match Query

The below sample responds with a list of documents in which the field _name_ contains the exact matching term specified in the _term_ field. For example, "40-Mile Air".

### [](#curl-request-3)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
"query": {
  "field": "name",
  "match": "40-Mile Air"
  }
}'

### [](#curl-response-3)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
	"request":{
    "query":{
      "match":"40-Mile Air",
      "field":"name",
      "prefix_length":0,
      "fuzziness":0,
      "operator":"or"
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
	"hits":[
		{
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"airportDoc",
      "score":10.30528795525373,
      "sort":["_score"],
      "fields":{"_$c":"airline"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_16687",
      "score":1.085367329598051,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
	"total_hits":2,
  "max_score":10.30528795525373,
  "took":86844745,
  facets":null
}

## [](#match%5Fphrase-query)Match\_Phrase query

The below sample responds with a list of documents in which the field _name_ contains the exactly matching phrase specifed in _match\_phrase_. For example, **40-Mile Air**.

### [](#curl-request-4)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
  "query": {
    "match_phrase": "40-Mile Air",
    "field": "name"
  }
}'

### [](#curl-response-4)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "match_phrase":
      "40-Mile Air",
      "field":"name"
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"airportDoc",
      "score":10.305287955253732,
      "locations":{
        "name":{
          "40":[
            {
              "pos":1,
              "start":0,
              "end":2,
              "array_positions":null
            }
          ],
          "air":[
            {
              "pos":3,
              "start":8,
              "end":11,
              "array_positions":null
            }
          ],
          "mile":[
            {
              "pos":2,
              "start":3,
              "end":7,
              "array_positions":null
            }
          ]
        }
      },
      "sort":["_score"],
      "fields":{"_$c":"airline"}
    }
  ],
  "total_hits":1,
  "max_score":10.305287955253732,
  "took":62498613,
  "facets":null
}

## [](#fuzzy-query)Fuzzy Query

The below sample responds with a list of documents in which the field _name_ contains the term that matches with the phrase specified in the _match_ field. For example, **40-Mile Air**. It considers the matching to a degree specified in the _fuzziness_ field instead of exact matching.

### [](#curl-request-5)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
  "query": {
    "field": "name",
    "match": "40-Mile Air",
    "fuzziness": 2
  }
}'

### [](#curl-response-5)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "match":"40-Mile Air",
      "field":"name",
      "prefix_length":0,
      "fuzziness":2,
      "operator":"or"
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
      {
        "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
        "id":"hotel_19199","score":0.17049220881184127,
        "sort":["_score"],
        "fields":{"_$c":"hotel"}
      },
      {
        "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
        "id":"airportDoc",
        "score":0.0956994969941305,
        "sort":["_score"],
        "fields":{"_$c":"airline"}
      },
      {
        "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
        "id":"hotel_21608",
        "score":0.05690871682349641,
        "sort":["_score"],
        "fields":{"_$c":"hotel"}
      },
      {
        "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
        "id":"hotel_19326",
        "score":0.05579005002540549,
        "sort":["_score"],
        "fields":{"_$c":"hotel"}
      },
      {
        "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
        "id":"hotel_21037",
        "score":0.05061580360832486,
        "sort":["_score"],
        "fields":{"_$c":"hotel"}
      },
      {
        "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
        "id":"hotel_35854",
        "score":0.04431672583269436,
        "sort":["_score"],
        "fields":{"_$c":"hotel"}
      },
      {
        "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
        "id":"hotel_3491",
        "score":0.04321478718467854,
        "sort":["_score"],
        "fields":{"_$c":"hotel"}
      },
      {
        "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
        "id":"hotel_20421",
        "score":0.04286437075446538,
        "sort":["_score"],
        "fields":{"_$c":"hotel"}
      },
      {
        "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
        "id":"hotel_1362",
        "score":0.037911531284201695,
        "sort":["_score"],
        "fields":{"_$c":"hotel"}
      },
      {
        "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
        "id":"hotel_21721",
        "score":0.037911531284201695,
        "sort":["_score"],
        "fields":{"_$c":"hotel"}
      }
    ],
    "total_hits":163,
    "max_score":0.17049220881184127,
    "took":21410046,
    "facets":null
  }

### [](#curl-request-6)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
  "query": {
    "field": "name",
    "match": "40-Mile Air",
    "fuzziness": 1
  },
  "includeLocations": true
}'

### [](#curl-response-6)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
	"request":{
    "query":{
      "match":"40-Mile Air",
      "field":"name",
      "prefix_length":0,
      "fuzziness":0,
      "operator":"or"
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
	"hits":[
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"airportDoc",
      "score":10.30528795525373,
      "sort":["_score"],
      "fields":{"_$c":"airline"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_16687",
      "score":1.085367329598051,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
	"total_hits":2,
  "max_score":10.30528795525373,
  "took":86844745,
  "facets":null
}

### [](#curl-request-7)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
  "query": {
    "field": "name",
    "match": "40-Mile Air",
    "fuzziness": 2
  },
  "includeLocations": true, "analyzer": "standard"
}'

### [](#curl-response-7)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "match":"40-Mile Air",
      "field":"name",
      "prefix_length":0,
      "fuzziness":2,
      "operator":"or"
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":true,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_19199",
      "score":0.17049220881184127,
      "locations":{
        "name":{
          "aire":[
            {
              "pos":1,
              "start":0,
              "end":4,
              "array_positions":null
            },
            {
              "pos":5,
              "start":26,
              "end":30,
              "array_positions":null
            }
          ],
          "le":[
            {
              "pos":3,
              "start":15,
              "end":17,
              "array_positions":null
            }
          ]
        }
      },
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"airportDoc",
      "score":0.0956994969941305,
      "locations":{
        "name":{
          "40":[
            {
              "pos":1,
              "start":0,
              "end":2,
              "array_positions":null
            }
          ],
          "air":[
            {
              "pos":3,
              "start":8,
              "end":11,
              "array_positions":null
            }
          ],
          "mile":[
            {
              "pos":2,
              "start":3,
              "end":7,
              "array_positions":null
            }
          ]
        }
      },
      "sort":["_score"],
      "fields":{"_$c":"airline"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_21608",
      "score":0.05690871682349641,
      "locations":{
        "name":{
          "le":[
            {
              "pos":2,
              "start":6,
              "end":8,
              "array_positions":null
            }
          ],
          "m":[
            {
              "pos":3,
              "start":9,
              "end":10,
              "array_positions":null
            }
          ]
        }
      },
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_20421",
      "score":0.04286437075446538,
      "locations":{
        "name":{
          "nh":[
            {
              "pos":1,
              "start":0,
              "end":2,
              "array_positions":null
            }
          ],
          "nice":[
            {
              "pos":2,
              "start":3,
              "end":7,
              "array_positions":null
            }
          ]
        }
      },
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_1362",
      "score":0.037911531284201695,
      "locations":{
        "name":{
          "au":[
            {
              "pos":1,
              "start":0,
              "end":2,
              "array_positions":null
            }
          ]
        }
      },
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_21721",
      "score":0.037911531284201695,
      "locations":{
        "name":{
          "iv":[
            {
              "pos":3,
              "start":12,
              "end":14,
              "array_positions":null
            }
          ]
        }
      },
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
  "total_hits":163,
  "max_score":0.17049220881184127,
  "took":610500365,
  "facets":null
}

## [](#prefix-query)Prefix Query

The below sample responds with a list of documents in which the _name_ field contains the text that starts with the given prefix. For example, **Air**.

### [](#curl-request-8)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
  "fields" : ["name"],
  "query": {
    "field": "name",
    "prefix": "glasgow"
  }
}'

### [](#curl-response-8)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "prefix":"glasgow",
      "field":"name"
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":["name"],
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_10138",
      "score":6.026769086106564,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
  "total_hits":1,
  "max_score":6.026769086106564,
  "took":181596318,
  "facets":null
}

## [](#regex-query)Regex Query

The below sample responds with a list of documents in which the _name_ field contains the text in the given form of a regular expression. For example, _airport_.

### [](#curl-request-9)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
"query":{
    "field":"name","regexp":"a[h-i]r[o-p]+ort"}
  }'

### [](#curl-response-9)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "regexp":"a[h-i]r[o-p]+ort",
      "field":"name"},
      "size":10,
      "from":0,
      "highlight":null,
      "fields":null,
      "facets":null,
      "explain":false,
      "sort":["-_score"],
      "includeLocations":false,
      "search_after":null,
      "search_before":null
    },
  "hits":[
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_15913",
      "score":5.0166026709347635,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_37887",
      "score":4.486985781600578,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
  "total_hits":2,
  "max_score":5.0166026709347635,
  "took":64912635,
  "facets":null
}

## [](#wildcard-query)Wildcard Query

The below sample responds with a list of documents in which the _country_ field contains the name that starts with **f** and ends with **ce**. For example, _france_.

### [](#curl-request-10)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
  "size":10,
  "from":10,
  "ctl":{"timeout":30},
  "query":{
    "wildcard":"f*ce",
    "field":"country"
  }
}'

### [](#curl-response-10)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "wildcard":"f*ce",
      "field":"country"
    },
    "size":10,
    "from":10,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_21850",
      "score":6.175990572936377,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_21872",
      "score":6.175990572936377,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_24536",
      "score":6.175990572936377,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_21837",
      "score":6.175990572936377,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_21725",
      "score":6.175990572936377,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_21846",
      "score":6.175990572936377,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_40662",
      "score":6.175990572936377,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_35857",
      "score":6.175990572936377,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_21855",
      "score":6.175990572936377,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_21669","score":6.175990572936377,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
  "total_hits":141,
  "max_score":6.175990572936377,
  "took":49997068,
  "facets":null
}

## [](#query-string-query)Query String Query

The below sample responds with a list of documents in which the _name_ field contains the text that starts with **air** and the _country_ field contains the name _france_.

### [](#curl-request-11)Curl Request

The **name** field prefixed with _air_ and the **country** field contains _france_.

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
"query": {"query": "+name:air* +country:france"}}'

### [](#curl-response-11)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "query":"+name:air* +country:france"
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_19199",
      "score":3.166810600229102,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
  "total_hits":1,
  "max_score":3.166810600229102,
  "took":593704,
  "facets":null
}

### [](#curl-request-12)Curl Request

The below sample responds with a list of documents in which the **name** field is prefixed with _air_, and the **country** field contains anything other than _france_.

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
"query": {"query": "+name:air* -country:france"}}'

### [](#curl-response-12)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "query":"+name:air* -country:france"
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"airportDoc",
      "score":1.0997886699799067,
      "sort":["_score"],
      "fields":{"_$c":"airline"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_16687",
      "score":1.0997886699799067,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_15913",
      "score":0.9524449440916017,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_37887",
      "score":0.8518926457255296,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
  "total_hits":4,
  "max_score":1.0997886699799067,
  "took":537291,
  "facets":null
}

## [](#boosting-the-score)Boosting the score

The below sample responds with a list of documents in which both the _type_ field and _name_ field contains the term **airport** but the relevancy of the specified term, for example, _airport_ is more in the _name_ field than the _type_ field.

### [](#curl-request-13)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
"query": {
 "disjuncts":[
    {
     "field":"city",
     "match": "glossop",
     "boost":5
    },
    {
      "field":"title",
      "match":"glossop"
    }
  ]
}'

### [](#curl-response-13)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "disjuncts":[
        {
          "match":"glossop",
          "field":"city",
          "boost":5,
          "prefix_length":0,
          "fuzziness":0,
          "operator":"or"
        },
        {
          "match":"glossop",
          "field":"title",
          "prefix_length":0,
          "fuzziness":0,
          "operator":"or"
        }
      ],
      "min":0
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_10161",
      "score":11.390925020776914,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_10158",
      "score":11.390925020776914,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_10160",
      "score":11.390925020776914,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_10159",
      "score":0.9131614588308529,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
  "total_hits":4,
  "max_score":11.390925020776914,
  "took":339907764,
  "facets":null
}

## [](#conjuncts-and-disjuncts)Conjuncts and Disjuncts

The below sample responds with a list of documents in which the _name_ field contains the text that starts with air and the _testing_ field is not **false**, and the _country_ field does not contain **france**.

### [](#curl-request-14)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
  "query": {
    "conjuncts": [
      {
        "query": "+name:air*"
      },
      {
        "disjuncts": [
          {"query": "+testing:false"},
          {"query": "country:france"}
        ]
      }
    ]
  }
}'

### [](#curl-response-14)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "conjuncts":[
        {
          "query":"+name:air*"
        },
        {
          "disjuncts":[
            {
              "query":"+testing:false"
            },
            {
              "query":"country:france"
            }
          ],
          "min":0
        }
      ]
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_19199",
      "score":1.8423829850895888,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
  "total_hits":1,
  "max_score":1.8423829850895888,
  "took":81919182,
  "facets":null
}

## [](#boolean-query)Boolean Query

### [](#curl-request-15)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
  "query" : {
    "must": {
      "conjuncts":[{"field":"type", "match": "hotel"}, {"field":"country", "match": "france"}]
    },
    "must_not": {
      "disjuncts": [{"field":"country", "match": "united states"}]
    },
    "should": {
      "disjuncts": [{"field":"free_parking", "bool": true}]
    }
  }
}'

### [](#curl-response-15)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "must":{
        "conjuncts":[
          {
            "match":"hotel",
            "field":"type",
            "prefix_length":0,
            "fuzziness":0,
            "operator":"or"
          },
          {
            "match":"france",
            "field":"country",
            "prefix_length":0,
            "fuzziness":0,
            "operator":"or"
          }
        ]
      },
      "should":{
        "disjuncts":[
          {
            "bool":true,
            "field":"free_parking"
          }
        ],
        "min":0
      },
      "must_not":{
        "disjuncts":[
          {
            "match":"united states",
            "field":"country",
            "prefix_length":0,
            "fuzziness":0,
            "operator":"or"
          }
        ],
        "min":0
      }
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_21720",
      "score":9.381573976364228,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_21849",
      "score":9.381573976364228,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_20419",
      "score":9.381573976364228,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_21725",
      "score":9.381573976364228,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_20422",
      "score":9.381573976364228,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_21852",
      "score":9.381573976364228,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_21657",
      "score":9.381573976364228,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_21838",
      "score":9.381573976364228,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_21723",
      "score":9.381573976364228,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_1359",
      "score":9.381573976364228,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
  "total_hits":140,
  "max_score":9.381573976364228,
  "took":116599230,
  "facets":null
}

## [](#date-range-query)Date Range Query

> [!NOTE]
> This example needs an index created on beer-sample bucket.

The below sample responds with a list of documents in which the _updateOn_ field contains the date in between the _start_ date and _end_ date, both inclusive.

### [](#curl-request-16)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/<beer-sample-index-name>/query -d '{
  "query": {
    "start": "2001-01-01","inclusive_start": true,"end": "2021-08-11","inclusive_end": true,"field": "updated"
  }
}'

### [](#curl-response-16)Curl Response

{
  "status": {
  "total": 1,
  "failed": 0,
  "successful": 1
  },
  "request": {
  "query": {
      "start": "2001-01-01T00:00:00Z",
      "end": "2021-08-11T00:00:00Z",
      "inclusive_start": true,
      "inclusive_end": true,
      "field": "updated"
  },
  "size": 10,
  "from": 0,
  "highlight": null,
  "fields": null,
  "facets": null,
  "explain": false,
  "sort": ["-_score"],
  "includeLocations": false,
  "search_after": null,
  "search_before": null
  },
  "hits": [
    {
      "index": "bix_3a91439dbf1df8ee_4c1c5584",
      "id": "devil_s_canyon",
      "score": 0.716641821033877,
      "sort": ["_score"]
    },
    {
      "index": "bix_3a91439dbf1df8ee_4c1c5584",
      "id": "abita_brewing_company-strawberry",
      "score": 0.716641821033877,
      "sort": ["_score"]
    },
    ...
    {
      "index": "bix_3a91439dbf1df8ee_4c1c5584",
      "id": "cains-2008_culture_beer",
      "score": 0.716641821033877,
      "sort": ["_score"]
    },
    {
      "index": "bix_3a91439dbf1df8ee_4c1c5584",
      "id": "element_brewing_company-dark_element",
      "score": 0.716641821033877,
      "sort": ["_score"]
    }
  ],
  "total_hits": 7303,
  "max_score": 0.716641821033877,
  "took": 1447295,
  "facets": null
}

## [](#numeric-range-query)Numeric Range Query

The below sample responds with a list of documents in which the _id_ field is between the specified maximum (_max_) and minimum (_min_) values.

### [](#curl-request-17)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
  "query":{
    "field":"id",
    "max": 8100,
    "min": 8080
  }
}'

### [](#curl-response-17)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "min":10025,
      "max":10030,
      "field":"id"
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_10025",
      "score":0.922656832718857,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"hotel_10026",
      "score":0.922656832718857,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
  "total_hits":2,
  "max_score":0.922656832718857,
  "took":62274941,
  "facets":null
}

## [](#doc%5Fid-query)DOC\_ID QUERY

The below sample responds with a list of documents in which the document ID is any of the specified ids. For example, airline\_10 and airline\_10123.

### [](#curl-request-18)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
  "query":{
    "ids":["airline_10", "airline_10123"]
  }
}'

### [](#curl-response-18)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "ids":["airline_10","airline_10123"]
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"airline_10",
      "score":1,
      "sort":["_score"],
      "fields":{"_$c":"airline"}
    },
    {
      "index":"DemoIndex_580e3ee6ba3ac900_4c1c5584",
      "id":"airline_10123",
      "score":1,
      "sort":["_score"],
      "fields":{"_$c":"airline"}
    }
  ],
  "total_hits":2,
  "max_score":1,
  "took":139708973,
  "facets":null
}

## [](#bounded-rectangle-query)Bounded Rectangle Query

The below sample responds with a list of documents in which the geolocation (_geo_) is bounded between the specified _top\_left_ and _bottom\_right_.

### [](#curl-request-19)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
  "query": {
    "field": "geo",
    "bottom_right": [-66.9326, 24.9493],
    "top_left": [-125.0011, 49.5904]
  }
}'

### [](#curl-response-19)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "top_left":[-125.0011,49.5904],
      "bottom_right":[-66.9326,24.9493],
      "field":"geo"
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_23634",
      "score":0.5583933812203372,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_17932",
      "score":0.5583933812203372,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_25325",
      "score":0.2575082889947619,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_25155",
      "score":0.2575082889947619,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_25263",
      "score":0.2575082889947619,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_3785",
      "score":0.2575082889947619,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_25302",
      "score":0.2575082889947619,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_25195",
      "score":0.2575082889947619,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_25161",
      "score":0.2575082889947619,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_76059e8b3887351c_4c1c5584",
      "id":"hotel_25119",
      "score":0.2575082889947619,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
  "total_hits":361,
  "max_score":0.5583933812203372,
  "took":473390831,
  "facets":null
}

## [](#point-distance-query)Point Distance Query

The below sample responds with a list of documents in which the _location_ specified as geolocation is in the proximity of the distance specified in _distance_ field. A location is represented by means of longitude-latitude coordinate pairs.

### [](#curl-request-20)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
      "from": 0,
      "size": 10,
      "query": {
        "location": {
          "lon": -2.235143,
          "lat": 53.482358
        },
        "distance": "1mi",
        "field": "geo"
      },
      "sort": [
        {
          "by": "geo_distance",
          "field": "geo",
          "unit": "mi",
          "location": {
            "lon": -2.235143,
            "lat": 53.482358
          }
        }
      ]
    }'

### [](#curl-response-20)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "location":[-2.235143,53.482358],
      "distance":"1mi",
      "field":"geo"
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":null,
    "explain":false,
    "sort":[
      {
        "by":"geo_distance",
        "field":"geo",
        "location":{
          "lat":53.482358,
          "lon":-2.235143
        },
        "unit":"mi"
      }
    ],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_17413",
      "score":1.2317379157866246,
      "sort":[" \u0001?U]S\\.e\u0002_"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_17414",
      "score":1.2317379157866246,
      "sort":[" \u0001?Z\u0000./\u0007Q\u0012\t"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_17415",
      "score":1.2317379157866246,
      "sort":[" \u0001?lg6,\u003c\u000cIL"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_17416",
      "score":1.2317379157866246,
      "sort":[" \u0001?r\u003cw\u0005GZ\u0005\u001f"],
      "fields":{"_$c":"hotel"}
    }
  ],
  "total_hits":4,
  "max_score":1.2317379157866246,
  "took":126456906,
  "facets":null
}

## [](#date-range-facets-query)Date Range Facets Query

> [!NOTE]
> This example needs an index created on beer-sample bucket.

### [](#curl-request-21)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/<beer-sample-index-name>/query -d '{
  "query": {
    "field": "style",
    "term": "beer"
  },
  "facets": {
    "types": {
      "size": 10,
      "field": "updated",
      "date_ranges": [
        {
          "name": "old",
          "end": "2011-01-01"
        },
        {
          "name": "new",
          "start": "2011-01-02"
        }
      ]
    }
  }
}'

### [](#curl-response-21)Curl Response

{
  "status": {
    "total": 1,
    "failed": 0,
    "successful": 1
  },
  "request": {
    "query": {
      "term": "beer",
      "field": "style"
    },
    "size": 10,
    "from": 0,
    "highlight": null,
    "fields": null,
    "facets": {
      "types": {
        "size": 10,
        "field": "updated",
        "date_ranges": [
          {
            "end": "2011-01-01",
            "name": "old",
            "start": "0001-01-01T00:00:00Z"
          },
          {
            "end": "0001-01-01T00:00:00Z",
            "name": "new",
            "start": "2011-01-02"
          }
        ]
      }
    },
    "explain": false,
    "sort": [
      "-_score"
    ],
    "includeLocations": false,
    "search_after": null,
    "search_before": null
  },
  "hits": [
    {
      "index": "bix_3a91439dbf1df8ee_4c1c5584",
      "id": "erie_brewing_company-derailed_black_cherry_ale",
      "score": 3.8396833650222075,
      "sort": ["_score"]
    },
    {
      "index": "bix_3a91439dbf1df8ee_4c1c5584",
      "id": "smuttynose_brewing_co-smuttynose_pumpkin_ale",
      "score": 3.8396833650222075,
      "sort": ["_score"]
    },
    ...
    {
      "index": "bix_3a91439dbf1df8ee_4c1c5584",
      "id": "warwick_valley_wine_co-doc_s_hard_apple_cider",
      "score": 3.8396833650222075,
      "sort": ["_score"]
    }
  ],
  "total_hits": 86,
  "max_score": 3.8396833650222075,
  "took": 155002,
  "facets": {
    "types": {
      "field": "updated",
      "total": 86,
      "missing": 0,
      "other": 0,
      "date_ranges": [
        {
          "name": "old",
          "end": "2011-01-01T00:00:00Z",
          "count": 81
        },
        {
          "name": "new",
          "start": "2011-01-02T00:00:00Z",
          "count": 5
        }
      ]
    }
  }
}

## [](#numeric-range-facet)Numeric Range facet

The below sample is to fetch the top 10 hotels based on the ratings given by the customers.

* Type Mapping ⇒ type:hotel
* child-field: reviews.ratings.Service
* Analyzer: standard

### [](#curl-request-22)Curl Request

curl -XPOST -H "Content-Type: application/json" -u <username>:<password> http://localhost:8094/api/index/DemoIndex/query -d '{
  "query": {
    "field": "reviews.content",
    "term": "good"
  },
  "facets": {
    "types": {
      "size": 10,
      "field": "reviews.ratings.Service",
      "numeric_ranges": [
        {
          "name": "Awesome",
          "min": 5
        },
        {
          "name": "Good",
          "max": 4
        },
          {
          "name": "Avg",
          "max": 3
        },
        {
          "name": "Poor",
          "max": 2
        },
        {
          "name": "Bad",
          "max": 1
        }
      ]
    }
  }
}'

### [](#curl-response-22)Curl Response

{
  "status":{
    "total":1,
    "failed":0,
    "successful":1
  },
  "request":{
    "query":{
      "term":"good",
      "field":"reviews.content"
    },
    "size":10,
    "from":0,
    "highlight":null,
    "fields":null,
    "facets":{
      "types":{
        "size":10,
        "field":"reviews.ratings.Service",
        "numeric_ranges":[
          {
            "name":"Awesome",
            "min":5
          },
          {
            "name":"Good",
            "max":4
          },
          {
            "name":"Avg",
            "max":3
          },
          {
            "name":"Poor",
            "max":2
          },
          {"name":"Bad",
          "max":1
          }
        ]
      }
    },
    "explain":false,
    "sort":["-_score"],
    "includeLocations":false,
    "search_after":null,
    "search_before":null
  },
  "hits":[
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_15134",
      "score":1.608775098615459,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_3491",
      "score":1.5929246603757872,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_9062",
      "score":1.3135594084905977,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_25261",
      "score":1.199110122199631,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_15976",
      "score":1.0384598347067433,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_26142",
      "score":1.029912757807367,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_3629",
      "score":0.9683687809619517,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_5848",
      "score":0.9479798384018671,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_16443",
      "score":0.9479797868886458,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    },
    {
      "index":"DemoIndex_41b91e3a4134783d_4c1c5584",
      "id":"hotel_2814",
      "score":0.9288267057398083,
      "sort":["_score"],
      "fields":{"_$c":"hotel"}
    }
  ],
  "total_hits":656,
  "max_score":1.608775098615459,
  "took":343585473,
  "facets":{
    "types": {
      "field":"reviews.ratings.Service",
      "total":1871,
      "missing":3,
      "other":0,
      "numeric_ranges":[
        {
          "name":"Good",
          "max":4,"count":658
        },
        {
          "name":"Awesome",
          "min":5,
          "count":579
        },
        {
          "name":"Avg",
          "max":3,
          "count":366
        },
        {
          "name":"Poor",
          "max":2,
          "count":219
        },
        {
          "name":"Bad",
          "max":1,
          "count":49
        }
      ]
    }
  }
}