Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
Cheshire-Cat
-
None
-
1
Description
Here is an example of a Facetted query for FTS ...
{
|
"query": { |
"query": "football" |
},
|
"facets": { |
"type": { |
"size": 2, |
"field": "text" |
}
|
}
|
}
|
An output for this query ..
{
|
"status": { |
"total": 1, |
"failed": 0, |
"successful": 1 |
},
|
"request": { |
"query": { |
"query": "football" |
},
|
"size": 10, |
"from": 0, |
"highlight": null, |
"fields": null, |
"facets": { |
"type": { |
"size": 2, |
"field": "text" |
}
|
},
|
"explain": false, |
"sort": [ |
"-_score" |
],
|
"includeLocations": false, |
"search_after": null, |
"search_before": null |
},
|
"hits": [ |
{
|
"index": "default_2008aa87a01d93e2_4c1c5584", |
"id": "two", |
"score": 0.22941572964191437, |
"sort": [ |
"_score" |
]
|
},
|
{
|
"index": "default_2008aa87a01d93e2_4c1c5584", |
"id": "one", |
"score": 0.16903084516525269, |
"sort": [ |
"_score" |
]
|
}
|
],
|
"total_hits": 2, |
"max_score": 0.22941572964191437, |
"took": 175236, |
"facets": { |
"type": { |
"field": "text", |
"total": 6, |
"missing": 0, |
"other": 2, |
"terms": [ |
{
|
"term": "football", |
"count": 2 |
},
|
{
|
"term": "play", |
"count": 2 |
}
|
]
|
}
|
}
|
}
|
N1QL as of today just processes the "hits" portion of the search response above. The "facets" details is a separate section within the search response which will need to be interpreted to support facetted FTS queries from within N1QL.