Closed juniorplenty closed 11 years ago
More info on search_type:
http://www.elasticsearch.org/guide/reference/api/search/search-type/
The do* methods are for the end points. I will expose setting the search_type parameter and you can then set that to "count" and use the doSearch method to achieve what you want.
ejs.Request({indices:test})
.searchType('count')
.facet(whateverFacet)
.doSearch()
Should be pretty easy to expose the search types, I will have a look right now.
Support for search types here.
https://github.com/fullscale/elastic.js/commit/23747ae3a7ecbed285814cee5878513a7e5d8918
Perfect, thanks!
Using the _search endpoint with query param search_type=count allows facets to be used with count queries, and is just as performant as the _count endpoint. Currently, elastic.js doesn't provide an option to utilize this execution path.
To enable this, the doCount method should change:
to:
...and should set:
(and other query types should clear that params entry)