setFrom for Facet Search

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

setFrom for Facet Search

Eugene Strokin
Hello,
I have a simple ordered facet search, and it works fine. The result is ordered by counts. I can set size of the result, but if I want to get a next chunk of the counts, how could I get it?
Here is my code:

SearchResponse response = clientProvider.getClient()

.prepareSearch(clientProvider.getIndexName())

        .addFacet(

        FacetBuilders.termsFacet("myStat")

        .field("myField")

        .order(ComparatorType.COUNT)

        .size(30)

        .facetFilter(FilterBuilders.rangeFilter("sequence")

.from(Utils.nextSequence()-1000*60*60*24)))

        .setTypes("myType")

        .execute()

        .actionGet();

So, I need something like setFrom() which we have for queries, but I need it for facet search, and it doesn't look like we have it.

Could you please help me out here?


Thank you,


Reply | Threaded
Open this post in threaded view
|

Re: setFrom for Facet Search

Igor Motov-3
I think all you can do at this moment is just retrieve 60 facets and ignore first 30. 

On Monday, May 14, 2012 8:47:19 PM UTC-4, Eugene Strokin wrote:
Hello,
I have a simple ordered facet search, and it works fine. The result is ordered by counts. I can set size of the result, but if I want to get a next chunk of the counts, how could I get it?
Here is my code:

SearchResponse response = clientProvider.getClient()

.prepareSearch(clientProvider.getIndexName())

        .addFacet(

        FacetBuilders.termsFacet("myStat")

        .field("myField")

        .order(ComparatorType.COUNT)

        .size(30)

        .facetFilter(FilterBuilders.rangeFilter("sequence")

.from(Utils.nextSequence()-1000*60*60*24)))

        .setTypes("myType")

        .execute()

        .actionGet();

So, I need something like setFrom() which we have for queries, but I need it for facet search, and it doesn't look like we have it.

Could you please help me out here?


Thank you,