org.hibernate.search.query.dsl.impl

## Class ConnectedSimpleQueryParser

- java.lang.Object
- - org.apache.lucene.util.QueryBuilder
  - - org.apache.lucene.queryparser.simple.SimpleQueryParser
    - - org.hibernate.search.query.dsl.impl.ConnectedSimpleQueryParser

-     public class ConnectedSimpleQueryParser
      extends SimpleQueryParser

  A FieldsContext aware implementation of the SimpleQueryParser of Lucene.
  Author:
    Guillaume Smet

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected List<FieldsContext>` | `fieldsContexts` Fields context as defined by the DSL

    - ### Fields inherited from class org.apache.lucene.queryparser.simple.SimpleQueryParser

      `AND_OPERATOR, ESCAPE_OPERATOR, flags, FUZZY_OPERATOR, NEAR_OPERATOR, NOT_OPERATOR, OR_OPERATOR, PHRASE_OPERATOR, PRECEDENCE_OPERATORS, PREFIX_OPERATOR, weights, WHITESPACE_OPERATOR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConnectedSimpleQueryParser(Analyzer analyzer, List<FieldsContext> fieldsContexts)` Creates a new parser searching over multiple fields with different weights.
    `ConnectedSimpleQueryParser(Analyzer analyzer, List<FieldsContext> fieldsContexts, int flags)` Creates a new parser with custom flags used to enable/disable certain features.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Query` | `newDefaultQuery(String text)` Factory method to generate a standard query (no phrase or prefix operators).
    `protected Query` | `newFuzzyQuery(String text, int fuzziness)` Factory method to generate a fuzzy query.
    `protected Query` | `newPhraseQuery(String text, int slop)` Factory method to generate a phrase query with slop.
    `protected Query` | `newPrefixQuery(String text)` Factory method to generate a prefix query.

    - ### Methods inherited from class org.apache.lucene.queryparser.simple.SimpleQueryParser

      `getDefaultOperator, parse, setDefaultOperator, simplify`

    - ### Methods inherited from class org.apache.lucene.util.QueryBuilder

      `createBooleanQuery, createBooleanQuery, createFieldQuery, createMinShouldMatchQuery, createPhraseQuery, createPhraseQuery, getAnalyzer, getEnablePositionIncrements, newBooleanQuery, newMultiPhraseQuery, newTermQuery, setAnalyzer, setEnablePositionIncrements`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### fieldsContexts

          protected final List<FieldsContext> fieldsContexts

      Fields context as defined by the DSL

  - ### Constructor Detail

    - #### ConnectedSimpleQueryParser

          public ConnectedSimpleQueryParser(Analyzer analyzer,
                                            List<FieldsContext> fieldsContexts)

      Creates a new parser searching over multiple fields with different weights.

    - #### ConnectedSimpleQueryParser

          public ConnectedSimpleQueryParser(Analyzer analyzer,
                                            List<FieldsContext> fieldsContexts,
                                            int flags)

      Creates a new parser with custom flags used to enable/disable certain features.

  - ### Method Detail

    - #### newDefaultQuery

          protected Query newDefaultQuery(String text)

      Factory method to generate a standard query (no phrase or prefix operators).
      Overrides:
        `newDefaultQuery` in class `SimpleQueryParser`

    - #### newFuzzyQuery

          protected Query newFuzzyQuery(String text,
                                        int fuzziness)

      Factory method to generate a fuzzy query.
      Overrides:
        `newFuzzyQuery` in class `SimpleQueryParser`

    - #### newPhraseQuery

          protected Query newPhraseQuery(String text,
                                         int slop)

      Factory method to generate a phrase query with slop.
      Overrides:
        `newPhraseQuery` in class `SimpleQueryParser`

    - #### newPrefixQuery

          protected Query newPrefixQuery(String text)

      Factory method to generate a prefix query.
      Overrides:
        `newPrefixQuery` in class `SimpleQueryParser`

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved