Class FieldQuery


  • public class FieldQuery
    extends java.lang.Object
    FieldQuery breaks down query object into terms/phrases and keeps them in a QueryPhraseMap structure.
    • Field Detail

      • fieldMatch

        final boolean fieldMatch
      • termSetMap

        java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> termSetMap
      • termOrPhraseNumber

        int termOrPhraseNumber
    • Constructor Detail

      • FieldQuery

        public FieldQuery​(Query query,
                          IndexReader reader,
                          boolean phraseHighlight,
                          boolean fieldMatch)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • FieldQuery

        FieldQuery​(Query query,
                   boolean phraseHighlight,
                   boolean fieldMatch)
            throws java.io.IOException
        For backwards compatibility you can initialize FieldQuery without an IndexReader, which is only required to support MultiTermQuery
        Throws:
        java.io.IOException
    • Method Detail

      • flatten

        protected void flatten​(Query sourceQuery,
                               IndexSearcher searcher,
                               java.util.Collection<Query> flatQueries,
                               float boost)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • expand

        java.util.Collection<Query> expand​(java.util.Collection<Query> flatQueries)
      • checkOverlap

        private void checkOverlap​(java.util.Collection<Query> expandQueries,
                                  PhraseQuery a,
                                  float aBoost,
                                  PhraseQuery b,
                                  float bBoost)
      • checkOverlap

        private void checkOverlap​(java.util.Collection<Query> expandQueries,
                                  Term[] src,
                                  Term[] dest,
                                  int slop,
                                  float boost)
      • getKey

        private java.lang.String getKey​(Query query)
      • saveTerms

        void saveTerms​(java.util.Collection<Query> flatQueries,
                       IndexSearcher searcher)
                throws java.io.IOException
        Throws:
        java.io.IOException
      • getTermSet

        private java.util.Set<java.lang.String> getTermSet​(Query query)
      • getTermSet

        java.util.Set<java.lang.String> getTermSet​(java.lang.String field)
      • getFieldTermMap

        public FieldQuery.QueryPhraseMap getFieldTermMap​(java.lang.String fieldName,
                                                         java.lang.String term)
        Returns:
        QueryPhraseMap
      • nextTermOrPhraseNumber

        int nextTermOrPhraseNumber()