Class QueryParserUtils
java.lang.Object
com.apple.foundationdb.record.lucene.search.QueryParserUtils
Utilities for use in using query parsers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.lucene.search.BooleanClause.OccurrelaxOccur(org.apache.lucene.search.Query q, org.apache.lucene.search.BooleanClause.Occur occur, org.apache.lucene.analysis.CharArraySet stopWords) Relax the modifier for the query, if possible.
-
Constructor Details
-
QueryParserUtils
public QueryParserUtils()
-
-
Method Details
-
relaxOccur
@Nonnull public static org.apache.lucene.search.BooleanClause.Occur relaxOccur(@Nonnull org.apache.lucene.search.Query q, @Nonnull org.apache.lucene.search.BooleanClause.Occur occur, @Nonnull org.apache.lucene.analysis.CharArraySet stopWords) Relax the modifier for the query, if possible. When there is a "MUST" for a prefix query on a stop word, turn that into a "SHOULD"- Parameters:
q- the queryoccur- the query modifierstopWords- the list of stop words- Returns:
- the modifier, modified if it should be relaxed
-