callumbwhyte/examine-facets

Adding sortfields, removes facets from response

Opened this issue · 0 comments

When trying to order a result, we have run into an issue, where the results would not include any facets.

Example with no facets:

var query = searcher.CreateQuery(); // gets a query from a BoboFacetSearcher

query = query.Facet("CategoryId").And();

query = query.GroupedOr(new[]{"Type"}, "type1", "type2", "type3").And();

var executor = query.All().OrderBy(new SortableField("Type"));

var results = executor.Execute(10);

To fix the above, we have moved the call to OrderBy to it's own line.

var executor = query.All();
executor.OrderBy(new SortableField("Type"));

var results = executor.Execute(10);

It seems that the result of the OrderBy output the underlying LuceneQuery from Examine, and not the BoboFacetQuery expected.