Lucene.Net.Search.Query.CreateWeight C# (CSharp) Method

CreateWeight() public method

Expert: Constructs an appropriate Weight implementation for this query.

Only implemented by primitive queries, which re-write to themselves.

public CreateWeight ( IndexSearcher searcher ) : Weight
searcher IndexSearcher
return Weight
        public virtual Weight CreateWeight(IndexSearcher searcher)
        {
            throw new System.NotSupportedException("Query " + this + " does not implement createWeight");
        }

Usage Example

Beispiel #1
0
        /// <summary> Returns a Weight that applies the filter to the enclosed query's Weight.
        /// This is accomplished by overriding the Scorer returned by the Weight.
        /// </summary>
        protected internal override Weight CreateWeight(Searcher searcher)
        {
            Weight     weight     = query.CreateWeight(searcher);
            Similarity similarity = query.GetSimilarity(searcher);

            return(new AnonymousClassWeight(weight, similarity, this));
        }
All Usage Examples Of Lucene.Net.Search.Query::CreateWeight