Class ProximityQueryNode

  • All Implemented Interfaces:
    java.lang.Cloneable, QueryNode

    public class ProximityQueryNode
    extends BooleanQueryNode
    A ProximityQueryNode represents a query where the terms should meet specific distance conditions. (a b c) WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER] ("a" "b" "c") WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER] TODO: Add this to the future standard Lucene parser/processor/builder
    • Constructor Detail

      • ProximityQueryNode

        public ProximityQueryNode​(java.util.List<QueryNode> clauses,
                                  java.lang.CharSequence field,
                                  ProximityQueryNode.Type type,
                                  int distance,
                                  boolean inorder)
        Parameters:
        clauses - - QueryNode children
        field - - field name
        type - - type of proximity query
        distance - - positive integer that specifies the distance
        inorder - - true, if the tokens should be matched in the order of the clauses
      • ProximityQueryNode

        public ProximityQueryNode​(java.util.List<QueryNode> clauses,
                                  java.lang.CharSequence field,
                                  ProximityQueryNode.Type type,
                                  boolean inorder)
        Parameters:
        clauses - - QueryNode children
        field - - field name
        type - - type of proximity query
        inorder - - true, if the tokens should be matched in the order of the clauses
    • Method Detail

      • cloneTree

        public QueryNode cloneTree()
                            throws java.lang.CloneNotSupportedException
        Description copied from interface: QueryNode
        Recursive clone the QueryNode tree The tags are not copied to the new tree when you call the cloneTree() method
        Specified by:
        cloneTree in interface QueryNode
        Overrides:
        cloneTree in class BooleanQueryNode
        Returns:
        the cloned tree
        Throws:
        java.lang.CloneNotSupportedException
      • getDistance

        public int getDistance()
        Returns:
        the distance
      • getField

        public java.lang.CharSequence getField()
        returns null if the field was not specified in the query string
        Returns:
        the field
      • getFieldAsString

        public java.lang.String getFieldAsString()
        returns null if the field was not specified in the query string
        Returns:
        the field
      • setField

        public void setField​(java.lang.CharSequence field)
        Parameters:
        field - the field to set
      • isInOrder

        public boolean isInOrder()
        Returns:
        terms must be matched in the specified order