Class QueryParserUtils

java.lang.Object
com.apple.foundationdb.record.lucene.search.QueryParserUtils

public class QueryParserUtils extends Object
Utilities for use in using query parsers.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.lucene.search.BooleanClause.Occur
    relaxOccur(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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 query
      occur - the query modifier
      stopWords - the list of stop words
      Returns:
      the modifier, modified if it should be relaxed