English 中文(简体)
Lucene.NET 2.9和BitArray/DocIdSet
原标题:Lucene.NET 2.9 and BitArray/DocIdSet

在基点上,我发现了一幅大举的gra光。 它储存基点的双线,每当面面值计算时改进性能。

        var genreQuery = new TermQuery(new Term("genre", genre));
        var genreQueryFilter = new QueryFilter(genreQuery);
        BitArray genreBitArray = genreQueryFilter.Bits(searcher.GetIndexReader());
        Console.WriteLine("There are " + GetCardinality(genreBitArray) + " document with the genre " + genre);

        // Next perform a regular search and get its BitArray result
        Query searchQuery = MultiFieldQueryParser.Parse(term, new[] {"title", "description"}, new[] {BooleanClause.Occur.SHOULD, BooleanClause.Occur.SHOULD}, new StandardAnalyzer());
        var searchQueryFilter = new QueryFilter(searchQuery);
        BitArray searchBitArray = searchQueryFilter.Bits(searcher.GetIndexReader());
        Console.WriteLine("There are " + GetCardinality(searchBitArray) + " document containing the term " + term);

唯一的问题是,我正在使用更新的卢塞内版本。 NET (2.9) and Filter. 比方陈旧。 我们被告知使用DocIdSet(而不是BitArray)。

我无法发现如何做仲裁。 And(Array) with a docIdSet. 我看着反射器,发现“开放式”系统已经运作。 我说,我不敢肯定开放式的Set是走路。

提前感谢!

最佳回答

创立。

            var productsDISI = new OpenBitSetDISI(productResults.Iterator(), 25000);
            var termQuery = new TermQuery(new Term("Spec" + expectedFacet.SpecificationId, expectedFacet.SpecificationOptionId.ToString()));
            var termQueryFilter = new QueryWrapperFilter(termQuery);
            var termIterator = termQueryFilter.GetDocIdSet(productReader).Iterator();
            productsDISI.InPlaceAnd(termIterator);
            var total = productsDISI.Cardinality();

速度也非常快。

问题回答

暂无回答




相关问题
How can I index HTML documents?

I am using Lucene .NEt to do full-text searching. Till now I have been indexing PDF docs, but now I have a few webpages that I need to index. What s the best/easiest way to index HTML documents to ...

Lucene.net: Separate building Index from Searching the Index

I created a website but i have a problem. i want to build once an index und use it. at the moment i have two functions "create a document an store it into the directory" and "searching" when the ...

Lucene .NET 2.3.2 Security Exception - Medium trust Issues

I m only partially able to get Lucene .NET to work on GoDaddy. It throws a security exception on this line: Hits hits = searcher.Search(query, filter); Here are the details of this exception: ...

Lucene.NET in medium trust

How do I make Lucene.NET 2.3.2 run in a medium trust environment? GoDaddy doesn t like it the way it is.

Storing relational data in a Lucene.NET index

I m currently trying to implement a Lucene.NET based search on a large database and I ve hit a snag trying to do a search on what is essentially relational data. At a high level the data I m trying ...

Trouble searching for acronyms in Lucene.NET

I m currently working on a Lucene.NET full-text search implementation. For the most part it s going quite well but I m having a few issues revolving around acronyms in the data... As an example of ...

Lucene.NET on shared hosting

I m trying to get Lucene.NET to work on a shared hosting environment. Mascix over on codeproject outlines here how he got this to work on godaddy. I m attempting this on isqsolutions. Both ...

热门标签