Class QueryParserWrapper

  • Direct Known Subclasses:
    MultiFieldQueryParserWrapper

    @Deprecated
    public class QueryParserWrapper
    extends Object
    Deprecated.
    this class will be removed soon, it's a temporary class to be used along the transition from the old query parser to the new one
    This class performs the query parsing using the new query parser implementation, but keeps the old QueryParser API.

    This class should be used when the new query parser features are and the old QueryParser API are needed at the same time.
    • Constructor Detail

      • QueryParserWrapper

        public QueryParserWrapper​(String defaultField,
                                  org.apache.lucene.analysis.Analyzer analyzer)
        Deprecated.
    • Method Detail

      • escape

        public static String escape​(String s)
        Deprecated.
        Returns a String where those characters that QueryParser expects to be escaped are escaped by a preceding \.
      • getField

        public String getField()
        Deprecated.
      • getAnalyzer

        public org.apache.lucene.analysis.Analyzer getAnalyzer()
        Deprecated.
      • setQueryBuilder

        public void setQueryBuilder​(StandardQueryBuilder builder)
        Deprecated.
        Sets the StandardQueryBuilder used to generate a Query object from the parsed and processed query node tree.
        Parameters:
        builder - the builder
      • getQueryConfigHandler

        public QueryConfigHandler getQueryConfigHandler()
        Deprecated.
        Returns the query config handler used by this query parser
        Returns:
        the query config handler
      • generateParseException

        public org.apache.lucene.queryParser.ParseException generateParseException()
        Deprecated.
      • getAllowLeadingWildcard

        public boolean getAllowLeadingWildcard()
        Deprecated.
      • getMultiTermRewriteMethod

        public org.apache.lucene.search.MultiTermQuery.RewriteMethod getMultiTermRewriteMethod()
        Deprecated.
      • getDateResolution

        public org.apache.lucene.document.DateTools.Resolution getDateResolution​(String fieldName)
        Deprecated.
      • getEnablePositionIncrements

        public boolean getEnablePositionIncrements()
        Deprecated.
      • getFuzzyMinSim

        public float getFuzzyMinSim()
        Deprecated.
      • getFuzzyPrefixLength

        public int getFuzzyPrefixLength()
        Deprecated.
      • getLocale

        public Locale getLocale()
        Deprecated.
      • getLowercaseExpandedTerms

        public boolean getLowercaseExpandedTerms()
        Deprecated.
      • getPhraseSlop

        public int getPhraseSlop()
        Deprecated.
      • getRangeCollator

        public Collator getRangeCollator()
        Deprecated.
      • getUseOldRangeQuery

        public boolean getUseOldRangeQuery()
        Deprecated.
      • parse

        public org.apache.lucene.search.Query parse​(String query)
                                             throws org.apache.lucene.queryParser.ParseException
        Deprecated.
        Throws:
        org.apache.lucene.queryParser.ParseException
      • setAllowLeadingWildcard

        public void setAllowLeadingWildcard​(boolean allowLeadingWildcard)
        Deprecated.
      • setMultiTermRewriteMethod

        public void setMultiTermRewriteMethod​(org.apache.lucene.search.MultiTermQuery.RewriteMethod method)
        Deprecated.
      • setDateResolution

        public void setDateResolution​(org.apache.lucene.document.DateTools.Resolution dateResolution)
        Deprecated.
      • setDateResolution

        public void setDateResolution​(String fieldName,
                                      org.apache.lucene.document.DateTools.Resolution dateResolution)
        Deprecated.
      • setEnablePositionIncrements

        public void setEnablePositionIncrements​(boolean enable)
        Deprecated.
      • setFuzzyMinSim

        public void setFuzzyMinSim​(float fuzzyMinSim)
        Deprecated.
      • setFuzzyPrefixLength

        public void setFuzzyPrefixLength​(int fuzzyPrefixLength)
        Deprecated.
      • setLocale

        public void setLocale​(Locale locale)
        Deprecated.
      • setLowercaseExpandedTerms

        public void setLowercaseExpandedTerms​(boolean lowercaseExpandedTerms)
        Deprecated.
      • setPhraseSlop

        public void setPhraseSlop​(int phraseSlop)
        Deprecated.
      • setRangeCollator

        public void setRangeCollator​(Collator rc)
        Deprecated.
      • setUseOldRangeQuery

        public void setUseOldRangeQuery​(boolean useOldRangeQuery)
        Deprecated.
      • getPrefixQuery

        protected org.apache.lucene.search.Query getPrefixQuery​(String field,
                                                                String termStr)
                                                         throws org.apache.lucene.queryParser.ParseException
        Deprecated.
        Throws:
        org.apache.lucene.queryParser.ParseException
      • getWildcardQuery

        protected org.apache.lucene.search.Query getWildcardQuery​(String field,
                                                                  String termStr)
                                                           throws org.apache.lucene.queryParser.ParseException
        Deprecated.
        Throws:
        org.apache.lucene.queryParser.ParseException
      • getFuzzyQuery

        protected org.apache.lucene.search.Query getFuzzyQuery​(String field,
                                                               String termStr,
                                                               float minSimilarity)
                                                        throws org.apache.lucene.queryParser.ParseException
        Deprecated.
        Throws:
        org.apache.lucene.queryParser.ParseException
      • getFieldQuery

        protected org.apache.lucene.search.Query getFieldQuery​(String field,
                                                               String queryText,
                                                               boolean quoted)
                                                        throws org.apache.lucene.queryParser.ParseException
        Deprecated.
        Throws:
        org.apache.lucene.queryParser.ParseException - throw in overridden method to disallow
      • getBooleanQuery

        protected org.apache.lucene.search.Query getBooleanQuery​(List<org.apache.lucene.search.BooleanClause> clauses,
                                                                 boolean disableCoord)
                                                          throws org.apache.lucene.queryParser.ParseException
        Deprecated.
        Throws:
        org.apache.lucene.queryParser.ParseException
      • getFieldQuery

        protected org.apache.lucene.search.Query getFieldQuery​(String field,
                                                               String queryText,
                                                               int slop)
                                                        throws org.apache.lucene.queryParser.ParseException
        Deprecated.
        Base implementation delegates to getFieldQuery(String,String). This method may be overridden, for example, to return a SpanNearQuery instead of a PhraseQuery.
        Throws:
        org.apache.lucene.queryParser.ParseException - throw in overridden method to disallow
      • getRangeQuery

        protected org.apache.lucene.search.Query getRangeQuery​(String field,
                                                               String part1,
                                                               String part2,
                                                               boolean inclusive)
                                                        throws org.apache.lucene.queryParser.ParseException
        Deprecated.
        Throws:
        org.apache.lucene.queryParser.ParseException - throw in overridden method to disallow