• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Search.Scorer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Lucene.Net.Search.Scorer的典型用法代码示例。如果您正苦于以下问题:C# Scorer类的具体用法?C# Scorer怎么用?C# Scorer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Scorer类属于Lucene.Net.Search命名空间,在下文中一共展示了Scorer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SetScorer

 public override void SetScorer(Scorer scorer)
 {
     foreach (DocComparator comparator in _comparators)
     {
         comparator.SetScorer(scorer);
     }
 }
开发者ID:modulexcite,项目名称:BoboBrowse.Net,代码行数:7,代码来源:MultiDocIdComparator.cs


示例2: DisjunctionScorer

 protected internal DisjunctionScorer(Weight weight, Scorer[] subScorers)
     : base(weight)
 {
     this.SubScorers = subScorers;
     this.NumScorers = subScorers.Length;
     Heapify();
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:7,代码来源:DisjunctionScorer.cs


示例3: Next

		public override bool Next()
		{
			if (firstTime)
			{
				if (!exclScorer.Next())
				{
					exclScorer = null; // exhausted at start
				}
				firstTime = false;
			}
			if (reqScorer == null)
			{
				return false;
			}
			if (!reqScorer.Next())
			{
				reqScorer = null; // exhausted, nothing left
				return false;
			}
			if (exclScorer == null)
			{
				return true; // reqScorer.next() already returned true
			}
			return ToNonExcluded();
		}
开发者ID:zweib730,项目名称:beagrep,代码行数:25,代码来源:ReqExclScorer.cs


示例4: CreateScorer

     public virtual Scorer CreateScorer(Scorer innerScorer, IndexReader reader, bool scoreDocsInOrder, bool topScorer)
     {
         if(!(reader is BoboIndexReader)) 
             throw new ArgumentException("IndexReader is not BoboIndexReader");
 
         return new FacetBasedBoostingScorer(this, (BoboIndexReader)reader, innerScorer.Similarity, innerScorer);
     }
开发者ID:yao-yi,项目名称:BoboBrowse.Net,代码行数:7,代码来源:FacetBasedBoostScorerBuilder.cs


示例5: ReqExclScorer

 /// <summary>Construct a <code>ReqExclScorer</code>.</summary>
 /// <param name="reqScorer">The scorer that must match, except where
 /// </param>
 /// <param name="exclScorer">indicates exclusion.
 /// </param>
 public ReqExclScorer(Scorer reqScorer, Scorer exclScorer)
     : base(null)
 {
     // No similarity used.
     this.reqScorer = reqScorer;
     this.exclScorer = exclScorer;
 }
开发者ID:vineelkovvuri,项目名称:ExtendableDesktopSearch,代码行数:12,代码来源:ReqExclScorer.cs


示例6: AssertingScorer

 private AssertingScorer(Random random, Scorer @in)
     : base(@in.Weight)
 {
     this.Random = random;
     [email protected] = @in;
     this.DocsEnumIn = new AssertingAtomicReader.AssertingDocsEnum(@in);
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:7,代码来源:AssertingScorer.cs


示例7: ReqExclScorer

 /// <summary>Construct a <code>ReqExclScorer</code>.</summary>
 /// <param name="reqScorer">The scorer that must match, except where
 /// </param>
 /// <param name="exclDisi">indicates exclusion.
 /// </param>
 public ReqExclScorer(Scorer reqScorer, DocIdSetIterator exclDisi)
     : base(null)
 {
     // No similarity used.
     this.reqScorer = reqScorer;
     this.exclDisi = exclDisi;
 }
开发者ID:BackupTheBerlios,项目名称:lyra2-svn,代码行数:12,代码来源:ReqExclScorer.cs


示例8: ReqOptSumScorer

 /// <summary>Construct a <code>ReqOptScorer</code>.</summary>
 /// <param name="reqScorer">The required scorer. This must match.
 /// </param>
 /// <param name="optScorer">The optional scorer. This is used for scoring only.
 /// </param>
 public ReqOptSumScorer(Scorer reqScorer, Scorer optScorer)
     : base(null)
 {
     // No similarity used.
     this.reqScorer = reqScorer;
     this.optScorer = optScorer;
 }
开发者ID:vineelkovvuri,项目名称:ExtendableDesktopSearch,代码行数:12,代码来源:ReqOptSumScorer.cs


示例9: SetScorer

 public override void SetScorer(Scorer scorer)
 {
     // Set a ScoreCachingWrappingScorer in case the wrapped Collector will call
     // score() also.
     this.scorer = new ScoreCachingWrappingScorer(scorer);
     c.SetScorer(this.scorer);
 }
开发者ID:BackupTheBerlios,项目名称:lyra2-svn,代码行数:7,代码来源:PositiveScoresOnlyCollector.cs


示例10: Score

		/// <summary>Returns the score of the current document matching the query.
		/// Initially invalid, until {@link #Next()} is called the first time.
		/// </summary>
		/// <returns> The score of the required scorer, eventually increased by the score
		/// of the optional scorer when it also matches the current document.
		/// </returns>
		public override float Score()
		{
			int curDoc = reqScorer.Doc();
			float reqScore = reqScorer.Score();
			if (firstTimeOptScorer)
			{
				firstTimeOptScorer = false;
				if (!optScorer.SkipTo(curDoc))
				{
					optScorer = null;
					return reqScore;
				}
			}
			else if (optScorer == null)
			{
				return reqScore;
			}
			else if ((optScorer.Doc() < curDoc) && (!optScorer.SkipTo(curDoc)))
			{
				optScorer = null;
				return reqScore;
			}
			// assert (optScorer != null) && (optScorer.doc() >= curDoc);
			return (optScorer.Doc() == curDoc)?reqScore + optScorer.Score():reqScore;
		}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:31,代码来源:ReqOptSumScorer.cs


示例11: SetScorer

 public override void SetScorer(Scorer _scorer)
 {
     this.scorer = _scorer;
     for (int i = 0; i < hitQueue.comparators.Length; i++)
     {
         hitQueue.comparators[i].SetScorer(_scorer);
     }
 }
开发者ID:NightOwl888,项目名称:Bobo-Browse.Net,代码行数:8,代码来源:InternalBrowseHitCollector.cs


示例12: ReqOptSumScorer

 /// <summary>
 /// Construct a <code>ReqOptScorer</code>. </summary>
 /// <param name="reqScorer"> The required scorer. this must match. </param>
 /// <param name="optScorer"> The optional scorer. this is used for scoring only. </param>
 public ReqOptSumScorer(Scorer reqScorer, Scorer optScorer)
     : base(reqScorer.weight)
 {
     Debug.Assert(reqScorer != null);
     Debug.Assert(optScorer != null);
     this.ReqScorer = reqScorer;
     this.OptScorer = optScorer;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:12,代码来源:ReqOptSumScorer.cs


示例13: Add

		/// <summary>Add the scorer for a subquery</summary>
		/// <param name="scorer">the scorer of a subquery of our associated DisjunctionMaxQuery
		/// </param>
		public virtual void  Add(Scorer scorer)
		{
			if (scorer.Next())
			{
				// Initialize and retain only if it produces docs
				subScorers.Add(scorer);
				more = true;
			}
		}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:12,代码来源:DisjunctionMaxScorer.cs


示例14: SubScorer

			public SubScorer(Scorer scorer, bool required, bool prohibited, HitCollector collector, SubScorer next)
			{
				this.scorer = scorer;
				this.done = !scorer.Next();
				this.required = required;
				this.prohibited = prohibited;
				this.collector = collector;
				this.next = next;
			}
开发者ID:zweib730,项目名称:beagrep,代码行数:9,代码来源:BooleanScorer.cs


示例15: ConjunctionScorer

        public ConjunctionScorer(Similarity similarity, Scorer[] scorers)
            : base(similarity)
        {
            this.scorers = scorers;
            coord = similarity.Coord(scorers.Length, scorers.Length);

            for (int i = 0; i < scorers.Length; i++)
            {
                if (scorers[i].NextDoc() == NO_MORE_DOCS)
                {
                    // If even one of the sub-scorers does not have any documents, this
                    // scorer should not attempt to do any more work.
                    lastDoc = NO_MORE_DOCS;
                    return ;
                }
            }

            // Sort the array the first time...
            // We don't need to sort the array in any future calls because we know
            // it will already start off sorted (all scorers on same doc).

            // note that this comparator is not consistent with equals!
            System.Array.Sort(scorers, new AnonymousClassComparator(this));

            // NOTE: doNext() must be called before the re-sorting of the array later on.
            // The reason is this: assume there are 5 scorers, whose first docs are 1,
            // 2, 3, 5, 5 respectively. Sorting (above) leaves the array as is. Calling
            // doNext() here advances all the first scorers to 5 (or a larger doc ID
            // they all agree on).
            // However, if we re-sort before doNext() is called, the order will be 5, 3,
            // 2, 1, 5 and then doNext() will stop immediately, since the first scorer's
            // docs equals the last one. So the invariant that after calling doNext()
            // all scorers are on the same doc ID is broken.
            if (DoNext() == NO_MORE_DOCS)
            {
                // The scorers did not agree on any document.
                lastDoc = NO_MORE_DOCS;
                return ;
            }

            // If first-time skip distance is any predictor of
            // scorer sparseness, then we should always try to skip first on
            // those scorers.
            // Keep last scorer in it's last place (it will be the first
            // to be skipped on), but reverse all of the others so that
            // they will be skipped on in order of original high skip.
            int end = scorers.Length - 1;
            int max = end >> 1;
            for (int i = 0; i < max; i++)
            {
                Scorer tmp = scorers[i];
                int idx = end - i - 1;
                scorers[i] = scorers[idx];
                scorers[idx] = tmp;
            }
        }
开发者ID:BackupTheBerlios,项目名称:lyra2-svn,代码行数:56,代码来源:ConjunctionScorer.cs


示例16: Wrap

 public static Scorer Wrap(Random random, Scorer other)
 {
     if (other == null || other is AssertingScorer)
     {
         return other;
     }
     AssertingScorer assertScorer = new AssertingScorer(random, other);
     ASSERTING_INSTANCES[other] = new WeakReference(assertScorer);
     return assertScorer;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:10,代码来源:AssertingScorer.cs


示例17: GetValues

	    /// <summary>
		/// <code>context</code> must contain a key "scorer" which is a
		/// <see cref="Lucene.Net.Search.Scorer">Lucene.Net.Search.Scorer</see>
		/// .
		/// </summary>
		/// <exception cref="System.IO.IOException"></exception>
		public override FunctionValues GetValues(IDictionary context, AtomicReaderContext
			 readerContext)
		{
			Scorer v = (Scorer)context["scorer"];
		    hashCodeObj = v;
			if (v == null)
			{
				throw new InvalidOperationException("Expressions referencing the score can only be used for sorting"
					);
			}
			return new ScoreFunctionValues(this, v);
		}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:18,代码来源:ScoreValueSource.cs


示例18: DisjunctionMaxScorer

		/// <summary> Creates a new instance of DisjunctionMaxScorer
		/// 
		/// </summary>
		/// <param name="tieBreakerMultiplier">Multiplier applied to non-maximum-scoring subqueries for a
		/// document as they are summed into the result.
		/// </param>
		/// <param name="similarity">-- not used since our definition involves neither coord nor terms
		/// directly
		/// </param>
		/// <param name="subScorers">The sub scorers this Scorer should iterate on
		/// </param>
		/// <param name="numScorers">The actual number of scorers to iterate on. Note that the array's
		/// length may be larger than the actual number of scorers.
		/// </param>
		public DisjunctionMaxScorer(float tieBreakerMultiplier, Similarity similarity, Scorer[] subScorers, int numScorers):base(similarity)
		{
			
			this.tieBreakerMultiplier = tieBreakerMultiplier;
			// The passed subScorers array includes only scorers which have documents
			// (DisjunctionMaxQuery takes care of that), and their nextDoc() was already
			// called.
			this.subScorers = subScorers;
			this.numScorers = numScorers;
			
			Heapify();
		}
开发者ID:synhershko,项目名称:lucene.net,代码行数:26,代码来源:DisjunctionMaxScorer.cs


示例19: Add

		internal void  Add(Scorer scorer)
		{
			if (length >= scorers.Length)
			{
				// grow the array
				Scorer[] temps = new Scorer[scorers.Length * 2];
				Array.Copy(scorers, 0, temps, 0, length);
				scorers = temps;
			}
			last += 1;
			length += 1;
			scorers[last] = scorer;
		}
开发者ID:zweib730,项目名称:beagrep,代码行数:13,代码来源:ConjunctionScorer.cs


示例20: Advance

 public override int Advance(int target)
 {
     if (reqScorer == null)
     {
         return doc = NO_MORE_DOCS;
     }
     if (exclDisi == null)
     {
         return doc = reqScorer.Advance(target);
     }
     if (reqScorer.Advance(target) == NO_MORE_DOCS)
     {
         reqScorer = null;
         return doc = NO_MORE_DOCS;
     }
     return doc = ToNonExcluded();
 }
开发者ID:BackupTheBerlios,项目名称:lyra2-svn,代码行数:17,代码来源:ReqExclScorer.cs



注:本文中的Lucene.Net.Search.Scorer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Search.Searcher类代码示例发布时间:2022-05-26
下一篇:
C# Search.ScoreDoc类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap