Exemple #1
0
        public SpanWeight(SpanQuery query, Searcher searcher)
        {
            this.similarity = query.GetSimilarity(searcher);
            this.query      = query;
            this.terms      = query.GetTerms();

            idf = this.query.GetSimilarity(searcher).Idf(terms, searcher);
        }
Exemple #2
0
		public SpanWeight(SpanQuery query, Searcher searcher)
		{
			this.similarity = query.GetSimilarity(searcher);
			this.query = query;
			this.terms = query.GetTerms();
			
			idf = this.query.GetSimilarity(searcher).Idf(terms, searcher);
		}
 /// <summary>Returns a collection of all terms matched by this query.</summary>
 /// <deprecated> use extractTerms instead
 /// </deprecated>
 /// <seealso cref="#ExtractTerms(Set)">
 /// </seealso>
 public override System.Collections.ICollection GetTerms()
 {
     System.Collections.ArrayList   terms = new System.Collections.ArrayList();
     System.Collections.IEnumerator i     = clauses.GetEnumerator();
     while (i.MoveNext())
     {
         SpanQuery clause = (SpanQuery)i.Current;
         terms.AddRange(clause.GetTerms());
     }
     return(terms);
 }
        public virtual void  TestRewrite1()
        {
            // mask an anon SpanQuery class that rewrites to something else.
            SpanQuery q = new FieldMaskingSpanQuery(new AnonymousClassSpanTermQuery(this, new Term("last", "sally")), "first");

            SpanQuery qr = (SpanQuery)searcher.Rewrite(q);

            QueryUtils.CheckUnequal(q, qr);

            Assert.AreEqual(2, qr.GetTerms().Count);
        }
        public virtual void  TestRewrite0()
        {
            SpanQuery q = new FieldMaskingSpanQuery(new SpanTermQuery(new Term("last", "sally")), "first");

            q.SetBoost(8.7654321f);
            SpanQuery qr = (SpanQuery)searcher.Rewrite(q);

            QueryUtils.CheckEqual(q, qr);

            Assert.AreEqual(1, qr.GetTerms().Count);
        }
Exemple #6
0
 /// <summary>Returns a collection of all terms matched by this query.</summary>
 /// <deprecated> use ExtractTerms instead
 /// </deprecated>
 /// <seealso cref="#ExtractTerms(Set)">
 /// </seealso>
 public override System.Collections.ICollection GetTerms()
 {
     return(match.GetTerms());
 }
 public override System.Collections.ICollection GetTerms()
 {
     return(include.GetTerms());
 }
Exemple #8
0
 public override IList <Lucene.Net.Index.Term> GetTerms()
 {
     return(include.GetTerms());
 }
Exemple #9
0
 public override IList <Lucene.Net.Index.Term> GetTerms()
 {
     return(match.GetTerms());
 }
 public override System.Collections.ICollection GetTerms()
 {
     return(maskedQuery.GetTerms());
 }
Exemple #11
0
 public override IList <Lucene.Net.Index.Term> GetTerms()
 {
     return(maskedQuery.GetTerms());
 }