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

C# Util.OpenBitSet类代码示例

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

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



OpenBitSet类属于Lucene.Net.Util命名空间,在下文中一共展示了OpenBitSet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:jinujoseph,项目名称:NuGet.Services.Metadata,代码行数:7,代码来源:BitSetCollector.cs


示例2: BitSetRandomAccessDocIdSet

 public BitSetRandomAccessDocIdSet(bool multi, MultiValueFacetDataCache multiCache, OpenBitSet openBitSet, FacetDataCache dataCache)
 {
     _multi = multi;
     _multiCache = multiCache;
     _openBitSet = openBitSet;
     _dataCache = dataCache;
 }
开发者ID:modulexcite,项目名称:BoboBrowse.Net,代码行数:7,代码来源:BitSetFilter.cs


示例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);
		}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:8,代码来源:TestOpenBitSet.cs


示例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;
 }
开发者ID:NightOwl888,项目名称:Bobo-Browse.Net,代码行数:8,代码来源:BigByteArray.cs


示例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;
 }
开发者ID:NightOwl888,项目名称:Bobo-Browse.Net,代码行数:8,代码来源:BigIntArray.cs


示例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));
     }
 }
开发者ID:Nangal,项目名称:lucene.net,代码行数:8,代码来源:TestOpenBitSet.cs


示例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;
 }
开发者ID:yao-yi,项目名称:BoboBrowse.Net,代码行数:9,代码来源:BigShortArray.cs


示例8: GetBitSet

 public virtual OpenBitSet GetBitSet(FacetDataCache dataCache)
 {
     if (lastCache == dataCache)
     {
         return bitSet;
     }
     bitSet = bitSetBuilder.BitSet(dataCache);
     lastCache = dataCache;
     return bitSet;
 }
开发者ID:modulexcite,项目名称:BoboBrowse.Net,代码行数:10,代码来源:BitSetFilter.cs


示例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);
		}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:11,代码来源:TestOpenBitSet.cs


示例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);
     }
 }
开发者ID:NightOwl888,项目名称:Bobo-Browse.Net,代码行数:11,代码来源:MultiValueORFacetFilter.cs


示例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);
		}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:12,代码来源:TestOpenBitSet.cs


示例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;
 }
开发者ID:jinujoseph,项目名称:NuGet.Services.Metadata,代码行数:13,代码来源:TenantFilter.cs


示例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);
     }
 }
开发者ID:NightOwl888,项目名称:Bobo-Browse.Net,代码行数:15,代码来源:FacetOrFilter.cs


示例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;
        }
开发者ID:modulexcite,项目名称:BoboBrowse.Net,代码行数:19,代码来源:ValueConverterBitSetBuilder.cs


示例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;
        }
开发者ID:VirtueMe,项目名称:ravendb,代码行数:27,代码来源:TermsFilter.cs


示例16: CorrectBits

        private OpenBitSet CorrectBits(IndexReader reader)
        {

            OpenBitSet bits = new OpenBitSet(reader.MaxDoc()); //assume all are INvalid
            Term startTerm = new Term(fieldName);
            TermEnum te = reader.Terms(startTerm);
            if (te != null)
            {
                Term currTerm = te.Term();
                while ((currTerm != null) && (currTerm.Field() == startTerm.Field())) //term fieldnames are interned
                {
                    int lastDoc = -1;
                    //set non duplicates
                    TermDocs td = reader.TermDocs(currTerm);
                    if (td.Next())
                    {
                        if (keepMode == KM_USE_FIRST_OCCURRENCE)
                        {
                            bits.Set(td.Doc());
                        }
                        else
                        {
                            do
                            {
                                lastDoc = td.Doc();
                            } while (td.Next());
                            bits.Set(lastDoc);
                        }
                    }
                    if (!te.Next())
                    {
                        break;
                    }
                    currTerm = te.Term();
                }
            }
            return bits;
        }
开发者ID:VirtueMe,项目名称:ravendb,代码行数:38,代码来源:DuplicateFilter.cs


示例17: GetDocIdSet

		public override DocIdSet GetDocIdSet(IndexReader reader)
		{
			var bits = new OpenBitSet(reader.MaxDoc());

			TermDocs termDocs = reader.TermDocs();
			List<double> area = _shape.Area;
			int sz = area.Count;
			
			// iterate through each boxid
			for (int i = 0; i < sz; i++)
			{
				double boxId = area[i];
				termDocs.Seek(new Term(_fieldName, NumericUtils.DoubleToPrefixCoded(boxId)));

				// iterate through all documents
				// which have this boxId
				while (termDocs.Next())
				{
					bits.FastSet(termDocs.Doc());
				}
			}

			return bits;
		}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:24,代码来源:CartesianShapeFilter.cs


示例18: NuGetIndexSearcher

        public NuGetIndexSearcher(
            NuGetSearcherManager manager,
            IndexReader reader,
            IDictionary<string, string> commitUserData,
            IDictionary<string, Filter> curatedFeeds,
            Filter[][] latest,
            IReadOnlyDictionary<string, int[]> docIdMapping,
            Downloads downloads,
            VersionResult[] versions,
            RankingResult rankings,
            QueryBoostingContext context,
            OpenBitSet latestBitSet,
            OpenBitSet latestStableBitSet,
            OwnersResult owners)
            : base(reader)
        {
            Manager = manager;
            CommitUserData = commitUserData;

            _curatedFeeds = new Dictionary<string, Filter>(curatedFeeds.Count);
            foreach (var curatedFeedsFilter in curatedFeeds)
            {
                _curatedFeeds.Add(curatedFeedsFilter.Key, new CachingWrapperFilter(curatedFeedsFilter.Value));
            }

            _latest = latest;
            DocIdMapping = docIdMapping;
            Downloads = downloads;
            Versions = versions;
            Rankings = rankings;
            LatestBitSet = latestBitSet;
            LatestStableBitSet = latestStableBitSet;
            Owners = owners;
            QueryBoostingContext = context;
            LastReopen = DateTime.UtcNow;
        }
开发者ID:NuGet,项目名称:NuGet.Services.Metadata,代码行数:36,代码来源:NuGetIndexSearcher.cs


示例19: TestEquals

		public virtual void  TestEquals()
		{
			rand = NewRandom();
			OpenBitSet b1 = new OpenBitSet(1111);
			OpenBitSet b2 = new OpenBitSet(2222);
			Assert.IsTrue(b1.Equals(b2));
			Assert.IsTrue(b2.Equals(b1));
			b1.Set(10);
			Assert.IsFalse(b1.Equals(b2));
			Assert.IsFalse(b2.Equals(b1));
			b2.Set(10);
			Assert.IsTrue(b1.Equals(b2));
			Assert.IsTrue(b2.Equals(b1));
			b2.Set(2221);
			Assert.IsFalse(b1.Equals(b2));
			Assert.IsFalse(b2.Equals(b1));
			b1.Set(2221);
			Assert.IsTrue(b1.Equals(b2));
			Assert.IsTrue(b2.Equals(b1));
			
			// try different type of object
			Assert.IsFalse(b1.Equals(new System.Object()));
		}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:23,代码来源:TestOpenBitSet.cs


示例20: FindIn

 private int FindIn(OpenBitSet OpenBitSet, int baseVal, int val)
 {
     return -1;
 }
开发者ID:modulexcite,项目名称:BoboBrowse.Net,代码行数:4,代码来源:P4DDocIdSet.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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