List<string> categories = new List<string>(); TermEnum te = reader.Terms(new Term("cat","")); categories.Add(te.Term().Text());
while (te.Next()) { if (te.Term().Field() != "cat") break; categories.Add(te.Term().Text()); } DIGY On Fri, May 20, 2011 at 2:28 PM, Marco Dissel <marco.dis...@gmail.com>wrote: > Thanks digy! Can you extend the sample to show us how you would get the > results to be used in a facet User interface, if you don't know the facet > terms in advance, including the number of hits. > > PseudoCode: > > Query query = new QueryParser("text", new > StandardAnalyzer()).Parse(searchText); > > IDictionary<string,long> categoryFacets = GetFacets("category", query, > numberOfMinimalHits); // only return items with a minimal hitcount. > > IDictionary<string,long> anotherFieldFacets = > GetFacets("anotherfacetfield", query, numberOfMinimalHits); > > > > Thanks! > > > On Fri, May 20, 2011 at 1:01 PM, digy digy <digyd...@gmail.com> wrote: > > > I prepared a sample. Maybe, this can help > > > > http://people.apache.org/~digy/FacetedSearch.cs > > > > DIGY > > > > > > On Fri, May 20, 2011 at 10:43 AM, K a r n a v <karunakerred...@gmail.com > > >wrote: > > > > > I've tried with OpenBitSetDISI...its not a performance effective > one.... > > > but > > > able generate results with BitArray fast enough.... > > > ... check the demo app > > > > > > > > > http://demo.wisestepp.com/jobs/JobSearchResults.aspx?am9ibmFtZSxqYXZh-yCfmbUTwmeY%3d > > > > > > If you have an example or sample code to work with > OpenBitSetDISI..please > > > fwd it to me... > > > > > > Thank you in advance. > > > > > > Regards, > > > Karunaker Reddy V > > > > > > > > > On Fri, May 20, 2011 at 1:05 PM, digy digy <digyd...@gmail.com> wrote: > > > > > > > Take a look at OpenBitSetDISI in Lucene.Net.Util > > > > > > > > DIGY > > > > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <larsaas...@gmail.com> > > > wrote: > > > > > > > > > Hi > > > > > Im building a search function with Lucene.NET where I want faceted > > > > > searches to be supported. To accomplish this in an efficient way I > > > > > thought a good idea would be to have a filter for each category and > > > > > then use the AND-operation between each category-filters BitArray > and > > > > > the BitArray for the search result, thus getting the search result > > > > > grouped by category by just using the AND-operation. Heres a > > blog-post > > > > > describing it better > > > > > > > > > > > > > > > > > > > > http://www.devatwork.nl/articles/lucenenet/faceted-search-and-drill-down-lucenenet/ > > > > > . > > > > > > > > > > Now, I see that the Bits-method is tagged as "obsolete" in the API > so > > > > > I guess it will be removed sometime in the future. So is there > > another > > > > > way of accomplish faceted searches in Lucene in a simular way or > > > > > should stick to the Bits-method to receive a BitArray anyway. > > > > > WebRep > > > > > Overall rating > > > > > > > > > > > > > > >