本文整理汇总了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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例5: _VisitorTemplate_55
public _VisitorTemplate_55(IntersectsPrefixTreeFilter _enclosing, AtomicReaderContext
baseArg1, IBits baseArg2,
bool baseArg3)
: base(_enclosing, baseArg1, baseArg2, baseArg3)
{
this._enclosing = _enclosing;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}