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

C# Index.AtomicReaderContext类代码示例

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

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



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

示例1: GetDocIdSet

 public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs)
 {
     Bits docsWithField = FieldCache.DEFAULT.GetDocsWithField(((AtomicReader)context.Reader), Field_Renamed);
     if (Negate_Renamed)
     {
         if (docsWithField is Bits_MatchAllBits)
         {
             return null;
         }
         return new FieldCacheDocIdSetAnonymousInnerClassHelper(this, context.AtomicReader.MaxDoc, acceptDocs, docsWithField);
     }
     else
     {
         if (docsWithField is Bits_MatchNoBits)
         {
             return null;
         }
         if (docsWithField is DocIdSet)
         {
             // UweSays: this is always the case for our current impl - but who knows
             // :-)
             return BitsFilteredDocIdSet.Wrap((DocIdSet)docsWithField, acceptDocs);
         }
         return new FieldCacheDocIdSetAnonymousInnerClassHelper2(this, context.AtomicReader.MaxDoc, acceptDocs, docsWithField);
     }
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:26,代码来源:FieldValueFilter.cs


示例2: GetValues

 public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
 {
     FunctionValues vals = source.GetValues(context, readerContext);
     FunctionValues targets = target.GetValues(context, readerContext);
     FunctionValues defaults = (this.defaultVal == null) ? null : defaultVal.GetValues(context, readerContext);
     return new FloatDocValuesAnonymousInnerClassHelper(this, this, vals, targets, defaults);
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:7,代码来源:RangeMapFloatFunction.cs


示例3: GetValues

		public override FunctionValues GetValues(IDictionary context, AtomicReaderContext
			 readerContext)
		{
			IDictionary<string, FunctionValues> valuesCache = (IDictionary<string, FunctionValues>)context["valuesCache"];
			if (valuesCache == null)
			{
				valuesCache = new Dictionary<string, FunctionValues>();
				context = new Hashtable(context);
				context["valuesCache"] = valuesCache;
			}
			FunctionValues[] externalValues = new FunctionValues[expression.variables.Length];
			for (int i = 0; i < variables.Length; ++i)
			{
				string externalName = expression.variables[i];
				FunctionValues values;
				if (!valuesCache.TryGetValue(externalName,out values))
				{
					values = variables[i].GetValues(context, readerContext);
					if (values == null)
					{
						throw new SystemException("Internal error. External (" + externalName + ") does not exist.");
					}
					valuesCache[externalName] = values;
				}
				externalValues[i] = values;
			}
			return new ExpressionFunctionValues(this, expression, externalValues);
		}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:28,代码来源:ExpressionValueSource.cs


示例4: GetValues

        public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
        {
            Fields fields = readerContext.AtomicReader.Fields;
            Terms terms = fields.Terms(indexedField);

            return new IntDocValuesAnonymousInnerClassHelper(this, this, terms);
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:7,代码来源:TermFreqValueSource.cs


示例5: _VisitorTemplate_55

 public _VisitorTemplate_55(IntersectsPrefixTreeFilter _enclosing, AtomicReaderContext
                                                                       baseArg1, IBits baseArg2,
                            bool baseArg3)
     : base(_enclosing, baseArg1, baseArg2, baseArg3)
 {
     this._enclosing = _enclosing;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:7,代码来源:IntersectsPrefixTreeFilter.cs


示例6: GetValues

        public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
        {
            var arr = cache.GetDoubles(readerContext.AtomicReader, field, parser, true);
            var valid = cache.GetDocsWithField(readerContext.AtomicReader, field);
            return new DoubleDocValuesAnonymousInnerClassHelper(this, arr, valid);

        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:7,代码来源:DoubleFieldSource.cs


示例7: GetValues

        public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
        {
            FunctionValues ifVals = ifSource.GetValues(context, readerContext);
            FunctionValues trueVals = trueSource.GetValues(context, readerContext);
            FunctionValues falseVals = falseSource.GetValues(context, readerContext);

            return new FunctionValuesAnonymousInnerClassHelper(this, ifVals, trueVals, falseVals);
        }
开发者ID:paulirwin,项目名称:lucene.net,代码行数:8,代码来源:IfFunction.cs


示例8: GetValues

        public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
        {
            var valsArr = new FunctionValues[sources.Length];
            for (int i = 0; i < sources.Length; i++)
            {
                valsArr[i] = sources[i].GetValues(context, readerContext);
            }

            return new FloatDocValuesAnonymousInnerClassHelper(this, this, valsArr);
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:10,代码来源:MultiFloatFunction.cs


示例9: GetDocIdSet

 public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs)
 {
     if (processingMode == ProcessingMode.PM_FAST_INVALIDATION)
     {
         return FastBits(context.AtomicReader, acceptDocs);
     }
     else
     {
         return CorrectBits(context.AtomicReader, acceptDocs);
     }
 }
开发者ID:apache,项目名称:lucenenet,代码行数:11,代码来源:DuplicateFilter.cs


示例10: GetValues

        // TODO: this is trappy? perhaps this query instead should make you pass a slow reader yourself?
        public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
        {
            IndexReader topReader = ReaderUtil.GetTopLevelContext(readerContext).Reader;
            AtomicReader r = SlowCompositeReaderWrapper.Wrap(topReader);
            int off = readerContext.DocBase;

            var sindex = FieldCache.DEFAULT.GetTermsIndex(r, field);
            var end = sindex.ValueCount;

            return new IntDocValuesAnonymousInnerClassHelper(this, this, off, sindex, end);
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:12,代码来源:ReverseOrdFieldSource.cs


示例11: GetValues

 public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
 {
     var searcher = (IndexSearcher)context["searcher"];
     TFIDFSimilarity sim = AsTFIDF(searcher.Similarity, field);
     if (sim == null)
     {
         throw new System.NotSupportedException("requires a TFIDFSimilarity (such as DefaultSimilarity)");
     }
     int docfreq = searcher.IndexReader.DocFreq(new Term(indexedField, indexedBytes));
     float idf = sim.Idf(docfreq, searcher.IndexReader.MaxDoc);
     return new ConstDoubleDocValues(idf, this);
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:12,代码来源:IDFValueSource.cs


示例12: DocTermsIndexDocValues

 protected DocTermsIndexDocValues(ValueSource vs, AtomicReaderContext context, string field)
 {
     try
     {
         termsIndex = FieldCache.DEFAULT.GetTermsIndex(context.AtomicReader, field);
     }
     catch (Exception e)
     {
         throw new DocTermsIndexException(field, e);
     }
     this.vs = vs;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:12,代码来源:DocTermsIndexDocValues.cs


示例13: 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


示例14: GetValues

        public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
        {
            var fields = readerContext.AtomicReader.Fields;
            var terms = fields.Terms(indexedField);
            var searcher = (IndexSearcher)context["searcher"];
            var similarity = IDFValueSource.AsTFIDF(searcher.Similarity, indexedField);
            if (similarity == null)
            {
                throw new System.NotSupportedException("requires a TFIDFSimilarity (such as DefaultSimilarity)");
            }

            return new FloatDocValuesAnonymousInnerClassHelper(this, this, terms, similarity);
        }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:13,代码来源:TFValueSource.cs


示例15: GetDocIdSet

        public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs)
        {
            Terms terms = context.AtomicReader.Terms(term.Field());
            if (terms == null)
            {
                return null;
            }

            TermsEnum termsEnum = terms.Iterator(null);
            if (!termsEnum.SeekExact(term.Bytes()))
            {
                return null;
            }
            return new DocIdSetAnonymousInnerClassHelper(this, acceptDocs, termsEnum);
        }
开发者ID:paulirwin,项目名称:lucene.net,代码行数:15,代码来源:TermFilter.cs


示例16: GetValues

 public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
 {
     FieldInfo fieldInfo = readerContext.AtomicReader.FieldInfos.FieldInfo(field);
     // To be sorted or not to be sorted, that is the question
     // TODO: do it cleaner?
     if (fieldInfo != null && fieldInfo.DocValuesType == FieldInfo.DocValuesType_e.BINARY)
     {
         BinaryDocValues binaryValues = Search.FieldCache.DEFAULT.GetTerms(readerContext.AtomicReader, field, true);
         Bits docsWithField = Search.FieldCache.DEFAULT.GetDocsWithField(readerContext.AtomicReader, field);
         return new FunctionValuesAnonymousInnerClassHelper(this, binaryValues, docsWithField);
     }
     else
     {
         return new DocTermsIndexDocValuesAnonymousInnerClassHelper(this, this, readerContext, field);
     }
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:16,代码来源:BytesRefFieldSource.cs


示例17: GetValues

        public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
        {
            var searcher = (IndexSearcher)context["searcher"];
            TFIDFSimilarity similarity = IDFValueSource.AsTFIDF(searcher.Similarity, field);
            if (similarity == null)
            {
                throw new System.NotSupportedException("requires a TFIDFSimilarity (such as DefaultSimilarity)");
            }

            NumericDocValues norms = readerContext.AtomicReader.GetNormValues(field);
            if (norms == null)
            {
                return new ConstDoubleDocValues(0.0, this);
            }

            return new FloatDocValuesAnonymousInnerClassHelper(this, this, similarity, norms);
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:17,代码来源:NormValueSource.cs


示例18: CustomScoreProviderAnonymousInnerClassHelper

 public CustomScoreProviderAnonymousInnerClassHelper(CustomMulAddQuery outerInstance, AtomicReaderContext context)
     : base(context)
 {
     this.outerInstance = outerInstance;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:5,代码来源:TestCustomScoreQuery.cs


示例19: GetValues

 public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
 {
     var searcher = (IndexSearcher)context["searcher"];
     int docfreq = searcher.IndexReader.DocFreq(new Term(indexedField, indexedBytes));
     return new ConstIntDocValues(docfreq, this);
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:6,代码来源:DocFreqValueSource.cs


示例20: GetCustomScoreProvider

 protected override CustomScoreProvider GetCustomScoreProvider(AtomicReaderContext context)
 {
     return new CustomScoreProviderAnonymousInnerClassHelper(this, context);
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:4,代码来源:TestCustomScoreQuery.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Index.DocumentsWriter类代码示例发布时间:2022-05-26
下一篇:
C# Index.AtomicReader类代码示例发布时间: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