예제 #1
0
 public PayloadTermQuery(Term term, PayloadFunction function, bool includeSpanScore)
     : base(term)
 {
     this.Function         = function;
     this.IncludeSpanScore = includeSpanScore;
 }
예제 #2
0
 public PayloadNearQuery(SpanQuery[] clauses, int slop, bool inOrder, PayloadFunction function)
     : base(clauses, slop, inOrder)
 {
     m_fieldName     = clauses[0].Field; // all clauses must have same field
     this.m_function = function;
 }
예제 #3
0
 public PayloadTermQuery(Term term, PayloadFunction function)
     : this(term, function, true)
 {
 }
 private PayloadNearQuery NewPhraseQuery(string fieldName, string phrase, bool inOrder, PayloadFunction function)
 {
     var words = _whiteSpaceRegex.Split(phrase);
     var clauses = new SpanQuery[words.Length];
     for (var i = 0; i < clauses.Length; i++)
     {
         clauses[i] = new SpanTermQuery(new Term(fieldName, words[i]));
     }
     return new PayloadNearQuery(clauses, 0, inOrder, function);
 }
        private PayloadNearQuery NewPhraseQuery(string fieldName, string phrase, bool inOrder, PayloadFunction function)
        {
            var words   = _whiteSpaceRegex.Split(phrase);
            var clauses = new SpanQuery[words.Length];

            for (var i = 0; i < clauses.Length; i++)
            {
                clauses[i] = new SpanTermQuery(new Term(fieldName, words[i]));
            }
            return(new PayloadNearQuery(clauses, 0, inOrder, function));
        }
 public PayloadNearQuery(SpanQuery[] clauses, int slop, bool inOrder, PayloadFunction function)
     : base(clauses, slop, inOrder)
 {
     fieldName = clauses[0].GetField(); // all clauses must have same field
     this.function = function;
 }
 /// <summary>
 /// macro for payloadtermquery </summary>
 private SpanQuery Pt(string s, PayloadFunction fn, bool includeSpanScore)
 {
     return new PayloadTermQuery(new Term(FIELD, s), fn, includeSpanScore);
 }
 public PayloadTermQuery(Term term, PayloadFunction function, bool includeSpanScore)
     : base(term)
 {
     this.function = function;
     this.includeSpanScore = includeSpanScore;
 }
 public PayloadTermQuery(Term term, PayloadFunction function)
     : this(term, function, true)
 {
 }
예제 #10
0
 private PayloadNearQuery NewPhraseQuery(string fieldName, string phrase, bool inOrder, PayloadFunction function)
 {
     string[] words = phrase.Split("[\\s]+".ToCharArray());
     SpanQuery[] clauses = new SpanQuery[words.Length];
     for (int i = 0; i < clauses.Length; i++)
     {
         clauses[i] = new SpanTermQuery(new Term(fieldName, words[i]));
     }
     return new PayloadNearQuery(clauses, 0, inOrder, function);
 }
예제 #11
0
 /// <summary>
 /// macro for payloadtermquery </summary>
 private SpanQuery Pt(string s, PayloadFunction fn, bool includeSpanScore)
 {
     return(new PayloadTermQuery(new Term(FIELD, s), fn, includeSpanScore));
 }
예제 #12
0
 private PayloadNearQuery NewPhraseQuery(string fieldName, string phrase, bool inOrder, PayloadFunction function)
 {
     string[]    words   = phrase.Split("[\\s]+".ToCharArray());
     SpanQuery[] clauses = new SpanQuery[words.Length];
     for (int i = 0; i < clauses.Length; i++)
     {
         clauses[i] = new SpanTermQuery(new Term(fieldName, words[i]));
     }
     return(new PayloadNearQuery(clauses, 0, inOrder, function));
 }