本文整理汇总了C#中Mono.Lucene.Net.Index.IndexReader.GetDeletesCacheKey方法的典型用法代码示例。如果您正苦于以下问题:C# Mono.Lucene.Net.Index.IndexReader.GetDeletesCacheKey方法的具体用法?C# Mono.Lucene.Net.Index.IndexReader.GetDeletesCacheKey怎么用?C# Mono.Lucene.Net.Index.IndexReader.GetDeletesCacheKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Lucene.Net.Index.IndexReader
的用法示例。
在下文中一共展示了Mono.Lucene.Net.Index.IndexReader.GetDeletesCacheKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDocIdSet
public override DocIdSet GetDocIdSet(IndexReader reader)
{
object coreKey = reader.GetFieldCacheKey();
object delCoreKey = reader.HasDeletions() ? reader.GetDeletesCacheKey() : coreKey;
object cached = cache.Get(reader, coreKey, delCoreKey);
if (cached != null)
{
hitCount++;
if (cached is DocIdSet)
return (DocIdSet) cached;
else
return new DocIdBitSet((System.Collections.BitArray) cached);
}
missCount++;
// cache miss
DocIdSet docIdSet = DocIdSetToCache(filter.GetDocIdSet(reader), reader);
if (docIdSet != null)
{
cache.Put(coreKey, delCoreKey, docIdSet);
}
return docIdSet;
}
示例2: GetCachedResult
private SpanFilterResult GetCachedResult(IndexReader reader)
{
object coreKey = reader.GetFieldCacheKey();
object delCoreKey = reader.HasDeletions() ? reader.GetDeletesCacheKey() : coreKey;
SpanFilterResult result = (SpanFilterResult) cache.Get(reader, coreKey, delCoreKey);
if (result != null) {
hitCount++;
return result;
}
missCount++;
result = filter.BitSpans(reader);
cache.Put(coreKey, delCoreKey, result);
return result;
}
示例3: Bits
public override System.Collections.BitArray Bits(IndexReader reader)
{
object coreKey = reader.GetFieldCacheKey();
object delCoreKey = reader.HasDeletions() ? reader.GetDeletesCacheKey() : coreKey;
object cached = cache.Get(reader, coreKey, delCoreKey);
if (cached != null)
{
if (cached is System.Collections.BitArray)
{
return (System.Collections.BitArray) cached;
}
else if (cached is DocIdBitSet)
return ((DocIdBitSet) cached).GetBitSet();
// It would be nice to handle the DocIdSet case, but that's not really possible
}
System.Collections.BitArray bits = filter.Bits(reader);
if (bits != null)
{
cache.Put(coreKey, delCoreKey, bits);
}
return bits;
}