Search { public boolean requiresPostProcessing() { return usesRelevance() || usesSorting(); } Search(List<Condition> filter,
                  List<Condition> query,
                  List<SortField> sort,
                  IndexPagingState paging,
                  Boolean refresh); boolean requiresPostProcessing(); boolean requiresFullScan(); boolean usesRelevance(); boolean usesSorting(); boolean isEmpty(); Query query(Schema schema, Query range); Query postProcessingQuery(Schema schema); boolean refresh(); List<org.apache.lucene.search.SortField> sortFields(Schema schema); IndexPagingState paging(); Set<String> postProcessingFields(); Search validate(Schema schema); @Override String toString(); final List<Condition> filter; final List<Condition> query; }
@Test public void testRequiresPostProcessing() { assertFalse("Requires post processing is wrong", filter(MATCH).build().requiresPostProcessing()); assertTrue("Requires post processing is wrong", query(MATCH).build().requiresPostProcessing()); assertFalse("Requires post processing is wrong", filter(MATCH).refresh(true).build().requiresPostProcessing()); assertTrue("Requires post processing is wrong", sort(FIELD).build().requiresPostProcessing()); assertFalse("Requires post processing is wrong", refresh(true).build().requiresPostProcessing()); assertFalse("Requires post processing is wrong", refresh(false).build().requiresPostProcessing()); assertFalse("Requires post processing is wrong", search().build().requiresPostProcessing()); assertTrue("Requires post processing is wrong", search().filter(MATCH).sort(FIELD).build().requiresPostProcessing()); assertTrue("Requires post processing is wrong", search().filter(MATCH).query(MATCH).sort(FIELD).build().requiresPostProcessing()); }