Class FixedBooleanQuery
java.lang.Object
org.apache.lucene.search.Query
org.graylog.plugins.views.search.validation.FixedBooleanQuery
- All Implemented Interfaces:
Iterable<org.apache.lucene.search.BooleanClause>
public class FixedBooleanQuery
extends org.apache.lucene.search.Query
implements Iterable<org.apache.lucene.search.BooleanClause>
The default BooleanQuery from lucene uses Multiset implementations in the visit method. These lose the reference
to the actual query instance and aggregate queries if they are the same. This breaks our terms detection in
validation. So we have to provide this alternative class that iterates bool clauses with correct references
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
int
hashCode()
Iterator<org.apache.lucene.search.BooleanClause>
iterator()
Spliterator<org.apache.lucene.search.BooleanClause>
void
visit
(org.apache.lucene.search.QueryVisitor visitor) This is the only purpose of this class - provide a simpler visit method that preserves the query reference to the underlying object.Methods inherited from class org.apache.lucene.search.Query
classHash, createWeight, rewrite, sameClassAs, toString
-
Constructor Details
-
FixedBooleanQuery
public FixedBooleanQuery(org.apache.lucene.search.BooleanQuery delegate)
-
-
Method Details
-
toString
- Specified by:
toString
in classorg.apache.lucene.search.Query
-
equals
- Specified by:
equals
in classorg.apache.lucene.search.Query
-
hashCode
public int hashCode()- Specified by:
hashCode
in classorg.apache.lucene.search.Query
-
iterator
-
forEach
-
spliterator
- Specified by:
spliterator
in interfaceIterable<org.apache.lucene.search.BooleanClause>
-
visit
public void visit(org.apache.lucene.search.QueryVisitor visitor) This is the only purpose of this class - provide a simpler visit method that preserves the query reference to the underlying object. That reference is then used to obtain related query terms during validation.- Specified by:
visit
in classorg.apache.lucene.search.Query
-