本文整理汇总了C#中Lucene.Net.Util.OpenBitSet类的典型用法代码示例。如果您正苦于以下问题:C# OpenBitSet类的具体用法?C# OpenBitSet怎么用?C# OpenBitSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OpenBitSet类属于Lucene.Net.Util命名空间,在下文中一共展示了OpenBitSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateBitSet
public static OpenBitSet CreateBitSet(IndexReader reader, Filter filter)
{
IndexSearcher searcher = new IndexSearcher(reader);
OpenBitSet result = new OpenBitSet();
searcher.Search(new MatchAllDocsQuery(), filter, new BitSetCollector(result));
return result;
}
示例2: BitSetRandomAccessDocIdSet
public BitSetRandomAccessDocIdSet(bool multi, MultiValueFacetDataCache multiCache, OpenBitSet openBitSet, FacetDataCache dataCache)
{
_multi = multi;
_multiCache = multiCache;
_openBitSet = openBitSet;
_dataCache = dataCache;
}
示例3: DoIterate
// test interleaving different OpenBitSetIterator.next()/skipTo()
internal virtual void DoIterate(System.Collections.BitArray a, OpenBitSet b, int mode)
{
if (mode == 1)
DoIterate1(a, b);
if (mode == 2)
DoIterate2(a, b);
}
示例4: FindValues
public override sealed int FindValues(OpenBitSet bitset, int docId, int maxId)
{
while (docId <= maxId && !bitset.FastGet(array[docId >> SHIFT_SIZE][docId & MASK]))
{
docId++;
}
return docId;
}
示例5: FindValues
public override int FindValues(OpenBitSet bitset, int docId, int maxId)
{
while (docId <= maxId && !bitset.FastGet(array[docId >> SHIFT_SIZE][docId & MASK]))
{
docId++;
}
return docId > maxId ? DocIdSetIterator.NO_MORE_DOCS : docId;
}
示例6: DoGet
internal virtual void DoGet(System.Collections.BitArray a, OpenBitSet b)
{
int max = a.Count;
for (int i = 0; i < max; i++)
{
Assert.AreEqual(a.Get(i) != b.Get(i), "mismatch: BitSet=[" + i + "]=" + a.Get(i));
}
}
示例7: FindValues
public override sealed int FindValues(OpenBitSet bitset, int docId, int maxId)
{
while (true)
{
if (bitset.FastGet(_array[docId >> SHIFT_SIZE][docId & MASK])) return docId;
if (docId++ >= maxId) break;
}
return DocIdSetIterator.NO_MORE_DOCS;
}
示例8: GetBitSet
public virtual OpenBitSet GetBitSet(FacetDataCache dataCache)
{
if (lastCache == dataCache)
{
return bitSet;
}
bitSet = bitSetBuilder.BitSet(dataCache);
lastCache = dataCache;
return bitSet;
}
示例9: DoNextSetBit
internal virtual void DoNextSetBit(System.Collections.BitArray a, OpenBitSet b)
{
int aa = - 1, bb = - 1;
do
{
aa = SupportClass.BitSetSupport.NextSetBit(a, aa + 1);
bb = b.NextSetBit(bb + 1);
Assert.AreEqual(aa, bb);
}
while (aa >= 0);
}
示例10: MultiValueORFacetFilter
public MultiValueORFacetFilter(MultiValueFacetDataCache dataCache, int[] index)
{
_dataCache = dataCache;
_nestedArray = dataCache._nestedArray;
_index = index;
_bitset = new OpenBitSet(_dataCache.valArray.Count);
foreach (int i in _index)
{
_bitset.FastSet(i);
}
}
示例11: DoIterate2
internal virtual void DoIterate2(System.Collections.BitArray a, OpenBitSet b)
{
int aa = - 1, bb = - 1;
OpenBitSetIterator iterator = new OpenBitSetIterator(b);
do
{
aa = SupportClass.BitSetSupport.NextSetBit(a, aa + 1);
bb = rand.NextDouble() > 0.5 ? iterator.NextDoc() : iterator.Advance(bb + 1);
Assert.AreEqual(aa == - 1?DocIdSetIterator.NO_MORE_DOCS:aa, bb);
}
while (aa >= 0);
}
示例12: GetDocIdSet
public override DocIdSet GetDocIdSet(IndexReader reader)
{
OpenBitSet bitSet = new OpenBitSet(reader.NumDocs());
TermDocs termDocs = reader.TermDocs(new Term("TenantId", _tenantId));
while (termDocs.Next())
{
if (termDocs.Freq > 0)
{
bitSet.Set(termDocs.Doc);
}
}
return bitSet;
}
示例13: FacetOrFilter
public FacetOrFilter(FacetDataCache dataCache, int[] index, bool takeCompliment)
{
this.dataCache = dataCache;
orderArray = dataCache.orderArray;
this.index = index;
bitset = new OpenBitSet(this.dataCache.valArray.Count);
foreach (int i in this.index)
{
bitset.FastSet(i);
}
if (takeCompliment)
{
bitset.Flip(0, this.dataCache.valArray.Count);
}
}
示例14: BitSet
public virtual OpenBitSet BitSet(FacetDataCache dataCache)
{
int[] index = facetValueConverter.Convert(dataCache, vals);
OpenBitSet bitset = new OpenBitSet(dataCache.ValArray.Count);
foreach (int i in index)
{
bitset.FastSet(i);
}
if (takeCompliment)
{
// flip the bits
for (int i = 0; i < index.Length; ++i)
{
bitset.FastFlip(i);
}
}
return bitset;
}
示例15: GetDocIdSet
/// <summary>
/// Get the DocIdSet.
/// </summary>
/// <param name="reader">Applcible reader.</param>
/// <returns>The set.</returns>
public override DocIdSet GetDocIdSet(IndexReader reader)
{
OpenBitSet result = new OpenBitSet(reader.MaxDoc());
TermDocs td = reader.TermDocs();
try
{
foreach (Term t in this.terms)
{
td.Seek(t);
while (td.Next())
{
result.Set(td.Doc());
}
}
}
finally
{
td.Close();
}
return result;
}