Search { @Override public String toString() { return MoreObjects.toStringHelper(this) .add("filter", filter) .add("query", query) .add("sort", sort) .add("refresh", refresh) .add("paging", paging) .toString(); } 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 testToString() { Search search = search().filter(match("f1", "v1").docValues(true), match("f2", "v2")) .query(match("f3", "v3"), match("f4", "v4").boost(0.3)) .sort(field("f5").reverse(true)) .refresh(true) .build(); assertEquals("Method #toString is wrong", "Search{filter=[MatchCondition{boost=null, field=f1, value=v1, docValues=true}, " + "MatchCondition{boost=null, field=f2, value=v2, docValues=false}], " + "query=[MatchCondition{boost=null, field=f3, value=v3, docValues=false}, " + "MatchCondition{boost=0.3, field=f4, value=v4, docValues=false}], " + "sort=[SimpleSortField{field=f5, reverse=true}], refresh=true, paging=null}", search.toString()); }