madrob commented on a change in pull request #117: URL: https://github.com/apache/solr/pull/117#discussion_r628272287
########## File path: solr/core/src/test/org/apache/solr/hamcrest/QueryMatchers.java ########## @@ -0,0 +1,184 @@ +package org.apache.solr.hamcrest; + +import org.apache.lucene.index.Term; +import org.apache.lucene.search.BooleanClause; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.BoostQuery; +import org.apache.lucene.search.DisjunctionMaxQuery; +import org.apache.lucene.search.PhraseQuery; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.TermQuery; +import org.hamcrest.Description; +import org.hamcrest.Matcher; +import org.hamcrest.TypeSafeDiagnosingMatcher; + +import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.is; + +public class QueryMatchers { + private QueryMatchers() {} + + public static Matcher<Query> termQuery(String field, String text) { Review comment: Hmm... let me think on how these should read. assertThat q is disjunctionOf (termQuery, termQuery, termQuery) assertThat q is boosted phraseQuery assertThat q is booleanQueryOf( shouldClause termQuery, mustClause termQuery) I like how the first two read but not quite satisfied with the last one. The `is` should be left out of the method name because callers can always add it where it grammatically makes sense. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org