Пример #1
0
            private System.Collections.ArrayList weights = new System.Collections.ArrayList();             // The Weight's for our subqueries, in 1-1 correspondence with disjuncts

            /* Construct the Weight for this Query searched by searcher.  Recursively construct subquery weights. */
            public DisjunctionMaxWeight(DisjunctionMaxQuery enclosingInstance, Searcher searcher)
            {
                InitBlock(enclosingInstance);
                this.similarity = searcher.GetSimilarity();
                for (int i = 0; i < Enclosing_Instance.disjuncts.Count; i++)
                {
                    weights.Add(((Query)Enclosing_Instance.disjuncts[i]).CreateWeight(searcher));
                }
            }
Пример #2
0
            protected internal System.Collections.ArrayList weights = new System.Collections.ArrayList();             // The Weight's for our subqueries, in 1-1 correspondence with disjuncts

            /* Construct the Weight for this Query searched by searcher.  Recursively construct subquery weights. */
            public DisjunctionMaxWeight(DisjunctionMaxQuery enclosingInstance, Searcher searcher)
            {
                InitBlock(enclosingInstance);
                this.similarity = searcher.GetSimilarity();
                for (System.Collections.IEnumerator iter = Enclosing_Instance.disjuncts.GetEnumerator(); iter.MoveNext();)
                {
                    weights.Add(((Query)iter.Current).CreateWeight(searcher));
                }
            }
Пример #3
0
            protected internal List <Weight> weights = new List <Weight>();           // The Weight's for our subqueries, in 1-1 correspondence with disjuncts

            /* Construct the Weight for this Query searched by searcher.  Recursively construct subquery weights. */
            public DisjunctionMaxWeight(DisjunctionMaxQuery enclosingInstance, Searcher searcher)
            {
                InitBlock(enclosingInstance);
                this.similarity = searcher.GetSimilarity();
                foreach (Query query in Enclosing_Instance.disjuncts)
                {
                    weights.Add(query.CreateWeight(searcher));
                }
            }
Пример #4
0
        /// <summary> Given a Searcher, returns a new MultiSearcher wrapping the
        /// the original Searcher,
        /// as well as several "empty" IndexSearchers -- some of which will have
        /// deleted documents in them.  This new MultiSearcher
        /// should behave exactly the same as the original Searcher.
        /// </summary>
        /// <param name="s">the Searcher to wrap
        /// </param>
        /// <param name="edge">if negative, s will be the first sub; if 0, s will be in hte middle, if positive s will be the last sub
        /// </param>
        public static MultiSearcher WrapSearcher(Searcher s, int edge)
        {
            // we can't put deleted docs before the nested reader, because
            // it will through off the docIds
            Searcher[]    searchers   = new Searcher[] { edge < 0?s:new IndexSearcher(MakeEmptyIndex(0)), new MultiSearcher(new Searcher[] { new IndexSearcher(MakeEmptyIndex(edge < 0?65:0)), new IndexSearcher(MakeEmptyIndex(0)), 0 == edge?s:new IndexSearcher(MakeEmptyIndex(0)) }), new IndexSearcher(MakeEmptyIndex(0 < edge?0:3)), new IndexSearcher(MakeEmptyIndex(0)), new MultiSearcher(new Searcher[] { new IndexSearcher(MakeEmptyIndex(0 < edge?0:5)), new IndexSearcher(MakeEmptyIndex(0)), 0 < edge?s:new IndexSearcher(MakeEmptyIndex(0)) }) };
            MultiSearcher out_Renamed = new MultiSearcher(searchers);

            out_Renamed.SetSimilarity(s.GetSimilarity());
            return(out_Renamed);
        }
Пример #5
0
 public MatchAllDocsWeight(MatchAllDocsQuery enclosingInstance, Searcher searcher)
 {
     InitBlock(enclosingInstance);
     this.similarity = searcher.GetSimilarity();
 }
Пример #6
0
 /// <summary>Expert: Returns the Similarity implementation to be used for this query.
 /// Subclasses may override this method to specify their own Similarity
 /// implementation, perhaps one that delegates through that of the Searcher.
 /// By default the Searcher's Similarity implementation is returned.
 /// </summary>
 public virtual Similarity GetSimilarity(Searcher searcher)
 {
     return(searcher.GetSimilarity());
 }
Пример #7
0
		/// <summary>Expert: Returns the Similarity implementation to be used for this query.
		/// Subclasses may override this method to specify their own Similarity
		/// implementation, perhaps one that delegates through that of the Searcher.
		/// By default the Searcher's Similarity implementation is returned.
		/// </summary>
		public virtual Similarity GetSimilarity(Searcher searcher)
		{
			return searcher.GetSimilarity();
		}
			public MatchAllDocsWeight(MatchAllDocsQuery enclosingInstance, Searcher searcher)
			{
				InitBlock(enclosingInstance);
				this.similarity = searcher.GetSimilarity();
			}
 /* Construct the Weight for this Query searched by searcher.  Recursively construct subquery weights. */
 public DisjunctionMaxWeight(DisjunctionMaxQuery enclosingInstance, Searcher searcher)
 {
     InitBlock(enclosingInstance);
     this.similarity = searcher.GetSimilarity();
     for (System.Collections.IEnumerator iter = Enclosing_Instance.disjuncts.GetEnumerator(); iter.MoveNext(); )
     {
         weights.Add(((Query) iter.Current).CreateWeight(searcher));
     }
 }
			private System.Collections.ArrayList weights = new System.Collections.ArrayList(); // The Weight's for our subqueries, in 1-1 correspondence with disjuncts
			
			/* Construct the Weight for this Query searched by searcher.  Recursively construct subquery weights. */
			public DisjunctionMaxWeight(DisjunctionMaxQuery enclosingInstance, Searcher searcher)
			{
				InitBlock(enclosingInstance);
				this.similarity = searcher.GetSimilarity();
				for (int i = 0; i < Enclosing_Instance.disjuncts.Count; i++)
					weights.Add(((Query) Enclosing_Instance.disjuncts[i]).CreateWeight(searcher));
			}
Пример #11
0
		/// <summary> Given a Searcher, returns a new MultiSearcher wrapping the  
		/// the original Searcher, 
		/// as well as several "empty" IndexSearchers -- some of which will have
		/// deleted documents in them.  This new MultiSearcher 
		/// should behave exactly the same as the original Searcher.
		/// </summary>
		/// <param name="s">the Searcher to wrap
		/// </param>
		/// <param name="edge">if negative, s will be the first sub; if 0, s will be in hte middle, if positive s will be the last sub
		/// </param>
		public static MultiSearcher WrapSearcher(Searcher s, int edge)
		{
			
			// we can't put deleted docs before the nested reader, because
			// it will through off the docIds
			Searcher[] searchers = new Searcher[]{edge < 0?s:new IndexSearcher(MakeEmptyIndex(0)), new MultiSearcher(new Searcher[]{new IndexSearcher(MakeEmptyIndex(edge < 0?65:0)), new IndexSearcher(MakeEmptyIndex(0)), 0 == edge?s:new IndexSearcher(MakeEmptyIndex(0))}), new IndexSearcher(MakeEmptyIndex(0 < edge?0:3)), new IndexSearcher(MakeEmptyIndex(0)), new MultiSearcher(new Searcher[]{new IndexSearcher(MakeEmptyIndex(0 < edge?0:5)), new IndexSearcher(MakeEmptyIndex(0)), 0 < edge?s:new IndexSearcher(MakeEmptyIndex(0))})};
			MultiSearcher out_Renamed = new MultiSearcher(searchers);
			out_Renamed.SetSimilarity(s.GetSimilarity());
			return out_Renamed;
		}
			protected internal List<Weight> weights = new List<Weight>(); // The Weight's for our subqueries, in 1-1 correspondence with disjuncts
			
			/* Construct the Weight for this Query searched by searcher.  Recursively construct subquery weights. */
			public DisjunctionMaxWeight(DisjunctionMaxQuery enclosingInstance, Searcher searcher)
			{
				InitBlock(enclosingInstance);
				this.similarity = searcher.GetSimilarity();
                foreach (Query query in Enclosing_Instance.disjuncts)
                {
                    weights.Add(query.CreateWeight(searcher));
                }
			}