当前位置: 首页>>代码示例>>C#>>正文


C# Index.AtomicReaderContext类代码示例

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


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


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