In case of you don't follow the dev list: https://issues.apache.org/jira/browse/LUCENENET-415 SimleFacetedSearch2.cs + TestSimleFacetedSearch2.cs
DIGY -----Original Message----- From: Floyd Wu [mailto:floyd...@gmail.com] Sent: Tuesday, May 24, 2011 6:40 AM To: lucene-net-user@lucene.apache.org Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method Hi DIGY, How can I use your sample to accomplish faceted search just like SOLR provided. for example: I would like to facet for 3 fields "category" / "author" / "folder". In your example, only faceted field "cat", should I do the same procedure three times to accomplish my requirement or do you have better way? Many thanks Floyd 2011/5/20 digy digy <digyd...@gmail.com> > 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-yCfmbU TwmeY%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-luc enenet/ > > > > > > . > > > > > > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > >