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
Inheritance: BooleanQueryNode
コード例 #1
0
        public override IQueryNode CloneTree()
        {
            ProximityQueryNode clone = (ProximityQueryNode)base.CloneTree();

            clone.proximityType = this.proximityType;
            clone.distance      = this.distance;
            clone.field         = this.field;

            return(clone);
        }
コード例 #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="clauses">QueryNode children</param>
 /// <param name="field">field name</param>
 /// <param name="type">type of proximity query</param>
 /// <param name="distance">positive integer that specifies the distance</param>
 /// <param name="inorder">true, if the tokens should be matched in the order of the clauses</param>
 public ProximityQueryNode(IList<IQueryNode> clauses, string field,
     ProximityQueryNode.Type type, int distance, bool inorder)
     : base(clauses)
 {
     IsLeaf = false;
     this.proximityType = type;
     this.inorder = inorder;
     this.field = field;
     if (type == ProximityQueryNode.Type.NUMBER)
     {
         if (distance <= 0)
         {
             throw new QueryNodeError(new MessageImpl(
                 QueryParserMessages.PARAMETER_VALUE_NOT_SUPPORTED, "distance",
                 distance));
         }
         else
         {
             this.distance = distance;
         }
     }
     ClearFields(clauses, field);
 }
コード例 #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="clauses">QueryNode children</param>
 /// <param name="field">field name</param>
 /// <param name="type">type of proximity query</param>
 /// <param name="inorder">true, if the tokens should be matched in the order of the clauses</param>
 public ProximityQueryNode(IList<IQueryNode> clauses, string field,
     ProximityQueryNode.Type type, bool inorder)
     : this(clauses, field, type, -1, inorder)
 {
 }
コード例 #4
0
 public ProximityType(ProximityQueryNode.Type type, int distance)
 {
     this.pType = type;
     this.pDistance = distance;
 }
コード例 #5
0
 public ProximityType(ProximityQueryNode.Type type)
         : this(type, 0)
 {
 }