You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by lars aslin <la...@gmail.com> on 2011/05/20 09:20:27 UTC

[Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

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

RE: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Digy <di...@gmail.com>.
See this old discussion
http://markmail.org/message/hyetqvex7bqnshek#query:+page:1+mid:zrew4dimoktd6
vex+state:results
and the attachment
http://markmail.org/download.xqy?id=zrew4dimoktd6vex&number=1

Maybe it can be useful.

DIGY


-----Original Message-----
From: Marco Dissel [mailto:marco.dissel@gmail.com] 
Sent: Saturday, May 28, 2011 7:57 PM
To: lucene-net-user@lucene.apache.org
Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without using the
Bits-method

Nice one ;-) here's another: "Don't reinvent the wheel, just realign it."

Let me rephrase my question, will the solr implementation perform better for
a large number of facets? i don't see any bitset parts, it seems to be based
on re-querying..

Thanks

On Sat, May 28, 2011 at 12:03 AM, Digy <di...@gmail.com> wrote:

> This reminded me of the old story
>
> "About four people named Everybody, Somebody, Anybody, and Nobody.
> There was an important job to be done and Everybody was sure that Somebody
> would do it.
> Anybody could have done it, but Nobody did it.
> Somebody got angry about that because it was Everybody's job.
> Everybody thought that Anybody could do it, but Nobody realized that
> Everybody wouldn't do it.
> It ended up that Everybody blamed Somebody when Nobody did what Anybody
> could have done."
>
> :)
>
> DIGY
>
> -----Original Message-----
> From: Marco Dissel [mailto:marco.dissel@gmail.com]
> Sent: Friday, May 27, 2011 4:46 PM
> To: lucene-net-user@lucene.apache.org
> Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without using the
> Bits-method
>
> Anyone tried to convert the solr implementation?
>
> see
>
>
http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/
> request/SimpleFacets.java?view=markup
>
>
> <
>
http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr
> /request/SimpleFacets.java?view=markup>
>
> On Fri, May 27, 2011 at 1:09 PM, digy digy <di...@gmail.com> wrote:
>
> > I create the SFS only once and use two fields for faceting(added one
more
> > field after my eMail  with 30 & 11 unique terms).
> > That is all.
> >
> > DIGY
> >
> > On Fri, May 27, 2011 at 2:00 PM, Marco Dissel <marco.dissel@gmail.com
> > >wrote:
> >
> > > Correct, but why do you get much better performance, according to a
> > > previous
> > > email?
> > >
> > > >> 30 facets, ~300K docs and 1.4GB index I get better results.(first
> > query:
> > > ~100-400 ms, if I repeat it then <10ms)
> > >
> > >
> > > On Fri, May 27, 2011 at 12:42 PM, digy digy <di...@gmail.com>
> wrote:
> > >
> > > > Suppose every field contains 20 unique terms, then you have
> 64,000,000
> > > > combinations to compute in constructor.
> > > > (I think, SFS finds only 949 of them usable(BitSets with >0
> > > cardinality)).
> > > >
> > > > DIGY
> > > >
> > > > On Fri, May 27, 2011 at 12:14 PM, Marco Dissel <
> marco.dissel@gmail.com
> > > > >wrote:
> > > >
> > > > > If I increase my number of facetfields to 6, the time to create a
> > > > > SimpleFacetedSearch instance is over ~ 10 minutes... (compiled in
> > > release
> > > > > and outside VisualStudio).. the number of HitsGroup is 949..
> > > > >
> > > > >
> > > > > On Fri, May 27, 2011 at 8:46 AM, Marco Dissel <
> > marco.dissel@gmail.com
> > > > > >wrote:
> > > > >
> > > > > > That's strange.. i'm using that version from svn
> > > > > >
> > > > > > The bold line is causing the slowness:
> > > > > >         Console.WriteLine(string.Format(" Facetsearch for
> > > > > > {0}",string.Join(",", fields)));
> > > > > >  Query query = new
> > > > > >
> > > Lucene.Net.QueryParsers.QueryParser(Lucene.Net.Util.Version.LUCENE_29,
> > > > > > "Content-Any", new
> > > > > >
> > > > >
> > > >
> > >
> >
>
>
Lucene.Net.Analysis.Standard.StandardAnalyzer(Lucene.Net.Util.Version.LUCENE
> _29)).Parse(value);
> > > > > >  Console.WriteLine(string.Format("  Facetsearch for
> > > > {0}",string.Join(",",
> > > > > > fields)));
> > > > > > DateTime start = DateTime.Now;
> > > > > > * using (SimpleFacetedSearch sfs = new
> SimpleFacetedSearch(_Reader,
> > > > > > fields)) {*
> > > > > > Console.WriteLine(string.Format("  Create facetsearcher
> > > > > {0}",((DateTime.Now
> > > > > > - start).TotalSeconds)));
> > > > > >
> > > > > > The facets are calculated on a searchresult set of ~32.000
items.
> > > > > >
> > > > > >   Facetsearch for company-owner
> > > > > >   Create facetsearcher 0,0760043
> > > > > >   Search facetsearcher 0,1560089
> > > > > >   Iterate facetsearcher 0,1570089
> > > > > > 0,2640151
> > > > > >   Facetsearch for company-owner,country
> > > > > >   Create facetsearcher 0,2550146
> > > > > >   Search facetsearcher 0,6630379
> > > > > >   Iterate facetsearcher 0,6680382
> > > > > > 0,6690383
> > > > > >   Facetsearch for company-owner,country,company-category
> > > > > >   Create facetsearcher 1,1110636
> > > > > >   Search facetsearcher 1,7340992
> > > > > >   Iterate facetsearcher 1,7410996
> > > > > > 1,7410996
> > > > > >   Facetsearch for
company-owner,country,company-category,language
> > > > > >   Create facetsearcher 5,0072864
> > > > > >   Search facetsearcher 6,0813479
> > > > > >   Iterate facetsearcher 6,0943486
> > > > > > 6,0963487
> > > > > >
> > > > > > On Fri, May 27, 2011 at 8:02 AM, digy digy <di...@gmail.com>
> > > wrote:
> > > > > >
> > > > > >> Indeed, I seems to be slow. With 30 facets, ~300K docs and
1.4GB
> > > index
> > > > I
> > > > > >> get
> > > > > >> better results.(first query: ~100-400 ms, if I repeat it then
> > <10ms)
> > > > > >> Do you use the code from
> > > > > >>
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
https://svn.apache.org/repos/asf/incubator/lucene.net/branches/Lucene.Net_2_
> 9_4g/src/contrib/SimpleFacetedSearch/
> > > > > >>  ?
> > > > > >>
> > > > > >> DIGY
> > > > > >>
> > > > > >>
> > > > > >> On Fri, May 27, 2011 at 12:49 AM, Marco Dissel <
> > > > marco.dissel@gmail.com
> > > > > >> >wrote:
> > > > > >>
> > > > > >> > You're are right.. It this the most optimal way of
calculating
> > > > > multiple
> > > > > >> > facets?
> > > > > >> >
> > > > > >> > I get this performance result in my test:
> > > > > >> > seconds - number of facet fields
> > > > > >> > 0,2760158 - 1
> > > > > >> > 0,665038 - 2
> > > > > >> > 1,7320991 - 3
> > > > > >> > 6,0633468 - 4
> > > > > >> >
> > > > > >> > on a ~300mb index
> > > > > >> >
> > > > > >> > Ideally i want to show an user interface with much more
> facets,
> > > but
> > > > > with
> > > > > >> > these numbers it's not possible.
> > > > > >> >
> > > > > >> > On Thu, May 26, 2011 at 8:10 AM, digy digy <
> digydigy@gmail.com>
> > > > > wrote:
> > > > > >> >
> > > > > >> > > I still don't understand, since these numbers can easily be
> > > > obtained
> > > > > >> from
> > > > > >> > > current implementation.
> > > > > >> > > Just count HitsPerGroup.Name[i]' s.
> > > > > >> > >
> > > > > >> > > DIGY
> > > > > >> > >
> > > > > >> > > On Thu, May 26, 2011 at 12:21 AM, Marco Dissel <
> > > > > >> marco.dissel@gmail.com
> > > > > >> > > >wrote:
> > > > > >> > >
> > > > > >> > > > Let's take the sample data from http://goo.gl/UQubj
> > > > > >> > > >
> > > > > >> > > >          f1     f2     f3
> > > > > >> > > >          --     --     --
> > > > > >> > > > doc1      A      I      1
> > > > > >> > > > doc2      A      I      2
> > > > > >> > > > doc3      A      I      3
> > > > > >> > > > doc4      A      J      1
> > > > > >> > > > doc5      A      J      2
> > > > > >> > > > doc6      A      J      3
> > > > > >> > > > doc7      B      I      1
> > > > > >> > > >
> > > > > >> > > > SimpleFacetedSearch sfs = new
SimpleFacetedSearch(_Reader,
> > new
> > > > > >> > > > string[] {"f1", "f2", "f3"});
> > > > > >> > > > SimpleFacetedSearch.Hits hits = sfs.Search(query);
> > > > > >> > > >
> > > > > >> > > > foreach(Facet facet in hits.Facets){ // groupByFields
from
> > > > > >> constructor
> > > > > >> > > >
> > > > > >> > > >   foreach(FacetTerm facetTerm in facet.FacetTerms){
> > > > > >> > > >
> > > > > >> > > >       WriteLine(facet.Field + facetTerm.Name +
> > > > > facetTerm.HitCount);
> > > > > >> > > >
> > > > > >> > > >   }
> > > > > >> > > >
> > > > > >> > > > }
> > > > > >> > > >
> > > > > >> > > > results in:
> > > > > >> > > > f1 - A - 6
> > > > > >> > > > f1 - B - 1
> > > > > >> > > > f2 - I - 4
> > > > > >> > > > f2 - J - 3
> > > > > >> > > > f3 - 1 - 3
> > > > > >> > > > f3 - 2 - 1
> > > > > >> > > > f3 - 3 - 3
> > > > > >> > > >
> > > > > >> > > > >> A *simple* example?
> > > > > >> > > >
> > > > > >> > > > I didn't say it's easy, the opposite..again thanks for
> your
> > > > time.
> > > > > >> > > >
> > > > > >> > > > On Wed, May 25, 2011 at 10:55 PM, Digy <
> digydigy@gmail.com>
> > > > > wrote:
> > > > > >> > > >
> > > > > >> > > > >
> > > > > >> > > > > Sorry Marco,
> > > > > >> > > > > I can't see your point. A *simple* example?
> > > > > >> > > > >
> > > > > >> > > > > DIGY
> > > > > >> > > > >
> > > > > >> > > > > -----Original Message-----
> > > > > >> > > > > From: Marco Dissel [mailto:marco.dissel@gmail.com]
> > > > > >> > > > > Sent: Wednesday, May 25, 2011 11:45 PM
> > > > > >> > > > > To: lucene-net-user@lucene.apache.org
> > > > > >> > > > > Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET
> > > without
> > > > > >> using
> > > > > >> > > the
> > > > > >> > > > > Bits-method
> > > > > >> > > > >
> > > > > >> > > > > Thank digy!
> > > > > >> > > > >
> > > > > >> > > > > The current sample is grouping the unique combinations
> of
> > > > > multiple
> > > > > >> > > facets
> > > > > >> > > > > fields, but what if you want to create an facet
> interface
> > > like
> > > > > on
> > > > > >> > this
> > > > > >> > > > > amazon.com page http://goo.gl/tBhuj ? The number of
> hits
> > > are
> > > > > >> based
> > > > > >> > on
> > > > > >> > > a
> > > > > >> > > > > single field query (click on "boxed set" will show 1148
> > > > hits)..
> > > > > >> > > > >
> > > > > >> > > > > Edition
> > > > > >> > > > >
> > > > > >> > > > >   - [image: Unselected Box]Boxed Set
> > > > > >> > > > > (1,148)<
> > > > > >> > > > >
> > > > > >>
> > > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fo
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
rmat_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=
> > > > > >> > > > > 672573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > > >> > > > >   - [image: Unselected Box]Full Screen
> > > > > >> > > > > (875)<
> > > > > >> > > > >
> > > > > >> >
> > > > >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
at_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=67
> > > > > >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > > >> > > > >   - [image: Unselected Box]Widescreen
> > > > > >> > > > > (606)<
> > > > > >> > > > >
> > > > > >> >
> > > > >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
at_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=67
> > > > > >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > > >> > > > >
> > > > > >> > > > > Region
> > > > > >> > > > >
> > > > > >> > > > >   - US & CA DVDs: Region 1
> > > > > >> > > > > (1,873)<
> > > > > >> > > > >
> > > > > >>
> > > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fe
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
ature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011
> > > > > >> > > > > &bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > > >> > > > >   - DVDs Playable Outside the US
> > > > > >> > > > > (1)<
> > > > > >> > > > >
> > > > > >> > >
> > > > > >>
> > > > >
> > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C67
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
2573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K7
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
9MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featur
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
e_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A129174
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
11%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn
> > > > > >> > > > > =672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > > >> > > > >   - DVDs Playable in any Region
> > > > > >> > > > > (62)<
> > > > > >> > > > >
> > > > > >> > >
> > > > > >>
> > > >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C6
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
72573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featu
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
re_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bb
> > > > > >> > > > > n=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > > > Thanks
> > > > > >> > > > >
> > > > > >> > > > > On Wed, May 25, 2011 at 12:08 AM, Digy <
> > digydigy@gmail.com>
> > > > > >> wrote:
> > > > > >> > > > >
> > > > > >> > > > > > 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.wu@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 <di...@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.dissel@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 <
> > > > > >> digydigy@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 <
> > > > > >> > > > > > > karunakerreddyv@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 <
> > > > > >> > > digydigy@gmail.com
> > > > > >> > > > >
> > > > > >> > > > > > > wrote:
> > > > > >> > > > > > > > > >
> > > > > >> > > > > > > > > > > Take a look at OpenBitSetDISI in
> > Lucene.Net.Util
> > > > > >> > > > > > > > > > >
> > > > > >> > > > > > > > > > > DIGY
> > > > > >> > > > > > > > > > >
> > > > > >> > > > > > > > > > > On Fri, May 20, 2011 at 10:20 AM, lars
aslin
> <
> > > > > >> > > > > > larsaaslin@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
> > > > > >> > > > > > > > > > > >
> > > > > >> > > > > > > > > > >
> > > > > >> > > > > > > > > >
> > > > > >> > > > > > > > >
> > > > > >> > > > > > > >
> > > > > >> > > > > > >
> > > > > >> > > > > >
> > > > > >> > > > > >
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>


Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Moray McConnachie <mm...@oxford-analytica.com>.
I have experimented with faceting without bitset using re-querying, and it works well for me, in fact we will roll this out within the next 3-6 months. 

We have a custom collector variant which simply accepts a list of field names each of which is a facet, and generates the terms and term counts for each facet during the collection process. 

With this method I have noticed faceting substantially increases search times (%-wise - absolute times remain reasonable) when I have searches that hit many documents, and I suspect search times may increase geometrically with documents returned, number of facets, and terms per facet. Since I store the faceting in memory without using numeric keys, memory could become an issue in the case of very large numbers of facets or terms.

Luckily I have relatively small numbers of all these, so I don't feel the need to generate a more efficient method (and there probably is one).

Moray
-------------------------------------
Moray McConnachie
Director of IT    +44 1865 261 600
Oxford Analytica  http://www.oxan.com


----- Original Message -----
From: Marco Dissel [mailto:marco.dissel@gmail.com]
Sent: Saturday, May 28, 2011 05:56 PM
To: lucene-net-user@lucene.apache.org <lu...@lucene.apache.org>
Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Nice one ;-) here's another: "Don't reinvent the wheel, just realign it."

Let me rephrase my question, will the solr implementation perform better for
a large number of facets? i don't see any bitset parts, it seems to be based
on re-querying..

Thanks

On Sat, May 28, 2011 at 12:03 AM, Digy <di...@gmail.com> wrote:

> This reminded me of the old story
>
> "About four people named Everybody, Somebody, Anybody, and Nobody.
> There was an important job to be done and Everybody was sure that Somebody
> would do it.
> Anybody could have done it, but Nobody did it.
> Somebody got angry about that because it was Everybody's job.
> Everybody thought that Anybody could do it, but Nobody realized that
> Everybody wouldn't do it.
> It ended up that Everybody blamed Somebody when Nobody did what Anybody
> could have done."
>
> :)
>
> DIGY
>
> -----Original Message-----
> From: Marco Dissel [mailto:marco.dissel@gmail.com]
> Sent: Friday, May 27, 2011 4:46 PM
> To: lucene-net-user@lucene.apache.org
> Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without using the
> Bits-method
>
> Anyone tried to convert the solr implementation?
>
> see
>
> http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/
> request/SimpleFacets.java?view=markup
>
>
> <
> http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr
> /request/SimpleFacets.java?view=markup>
>
> On Fri, May 27, 2011 at 1:09 PM, digy digy <di...@gmail.com> wrote:
>
> > I create the SFS only once and use two fields for faceting(added one more
> > field after my eMail  with 30 & 11 unique terms).
> > That is all.
> >
> > DIGY
> >
> > On Fri, May 27, 2011 at 2:00 PM, Marco Dissel <marco.dissel@gmail.com
> > >wrote:
> >
> > > Correct, but why do you get much better performance, according to a
> > > previous
> > > email?
> > >
> > > >> 30 facets, ~300K docs and 1.4GB index I get better results.(first
> > query:
> > > ~100-400 ms, if I repeat it then <10ms)
> > >
> > >
> > > On Fri, May 27, 2011 at 12:42 PM, digy digy <di...@gmail.com>
> wrote:
> > >
> > > > Suppose every field contains 20 unique terms, then you have
> 64,000,000
> > > > combinations to compute in constructor.
> > > > (I think, SFS finds only 949 of them usable(BitSets with >0
> > > cardinality)).
> > > >
> > > > DIGY
> > > >
> > > > On Fri, May 27, 2011 at 12:14 PM, Marco Dissel <
> marco.dissel@gmail.com
> > > > >wrote:
> > > >
> > > > > If I increase my number of facetfields to 6, the time to create a
> > > > > SimpleFacetedSearch instance is over ~ 10 minutes... (compiled in
> > > release
> > > > > and outside VisualStudio).. the number of HitsGroup is 949..
> > > > >
> > > > >
> > > > > On Fri, May 27, 2011 at 8:46 AM, Marco Dissel <
> > marco.dissel@gmail.com
> > > > > >wrote:
> > > > >
> > > > > > That's strange.. i'm using that version from svn
> > > > > >
> > > > > > The bold line is causing the slowness:
> > > > > >         Console.WriteLine(string.Format(" Facetsearch for
> > > > > > {0}",string.Join(",", fields)));
> > > > > >  Query query = new
> > > > > >
> > > Lucene.Net.QueryParsers.QueryParser(Lucene.Net.Util.Version.LUCENE_29,
> > > > > > "Content-Any", new
> > > > > >
> > > > >
> > > >
> > >
> >
>
> Lucene.Net.Analysis.Standard.StandardAnalyzer(Lucene.Net.Util.Version.LUCENE
> _29)).Parse(value);
> > > > > >  Console.WriteLine(string.Format("  Facetsearch for
> > > > {0}",string.Join(",",
> > > > > > fields)));
> > > > > > DateTime start = DateTime.Now;
> > > > > > * using (SimpleFacetedSearch sfs = new
> SimpleFacetedSearch(_Reader,
> > > > > > fields)) {*
> > > > > > Console.WriteLine(string.Format("  Create facetsearcher
> > > > > {0}",((DateTime.Now
> > > > > > - start).TotalSeconds)));
> > > > > >
> > > > > > The facets are calculated on a searchresult set of ~32.000 items.
> > > > > >
> > > > > >   Facetsearch for company-owner
> > > > > >   Create facetsearcher 0,0760043
> > > > > >   Search facetsearcher 0,1560089
> > > > > >   Iterate facetsearcher 0,1570089
> > > > > > 0,2640151
> > > > > >   Facetsearch for company-owner,country
> > > > > >   Create facetsearcher 0,2550146
> > > > > >   Search facetsearcher 0,6630379
> > > > > >   Iterate facetsearcher 0,6680382
> > > > > > 0,6690383
> > > > > >   Facetsearch for company-owner,country,company-category
> > > > > >   Create facetsearcher 1,1110636
> > > > > >   Search facetsearcher 1,7340992
> > > > > >   Iterate facetsearcher 1,7410996
> > > > > > 1,7410996
> > > > > >   Facetsearch for company-owner,country,company-category,language
> > > > > >   Create facetsearcher 5,0072864
> > > > > >   Search facetsearcher 6,0813479
> > > > > >   Iterate facetsearcher 6,0943486
> > > > > > 6,0963487
> > > > > >
> > > > > > On Fri, May 27, 2011 at 8:02 AM, digy digy <di...@gmail.com>
> > > wrote:
> > > > > >
> > > > > >> Indeed, I seems to be slow. With 30 facets, ~300K docs and 1.4GB
> > > index
> > > > I
> > > > > >> get
> > > > > >> better results.(first query: ~100-400 ms, if I repeat it then
> > <10ms)
> > > > > >> Do you use the code from
> > > > > >>
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> https://svn.apache.org/repos/asf/incubator/lucene.net/branches/Lucene.Net_2_
> 9_4g/src/contrib/SimpleFacetedSearch/
> > > > > >>  ?
> > > > > >>
> > > > > >> DIGY
> > > > > >>
> > > > > >>
> > > > > >> On Fri, May 27, 2011 at 12:49 AM, Marco Dissel <
> > > > marco.dissel@gmail.com
> > > > > >> >wrote:
> > > > > >>
> > > > > >> > You're are right.. It this the most optimal way of calculating
> > > > > multiple
> > > > > >> > facets?
> > > > > >> >
> > > > > >> > I get this performance result in my test:
> > > > > >> > seconds - number of facet fields
> > > > > >> > 0,2760158 - 1
> > > > > >> > 0,665038 - 2
> > > > > >> > 1,7320991 - 3
> > > > > >> > 6,0633468 - 4
> > > > > >> >
> > > > > >> > on a ~300mb index
> > > > > >> >
> > > > > >> > Ideally i want to show an user interface with much more
> facets,
> > > but
> > > > > with
> > > > > >> > these numbers it's not possible.
> > > > > >> >
> > > > > >> > On Thu, May 26, 2011 at 8:10 AM, digy digy <
> digydigy@gmail.com>
> > > > > wrote:
> > > > > >> >
> > > > > >> > > I still don't understand, since these numbers can easily be
> > > > obtained
> > > > > >> from
> > > > > >> > > current implementation.
> > > > > >> > > Just count HitsPerGroup.Name[i]' s.
> > > > > >> > >
> > > > > >> > > DIGY
> > > > > >> > >
> > > > > >> > > On Thu, May 26, 2011 at 12:21 AM, Marco Dissel <
> > > > > >> marco.dissel@gmail.com
> > > > > >> > > >wrote:
> > > > > >> > >
> > > > > >> > > > Let's take the sample data from http://goo.gl/UQubj
> > > > > >> > > >
> > > > > >> > > >          f1     f2     f3
> > > > > >> > > >          --     --     --
> > > > > >> > > > doc1      A      I      1
> > > > > >> > > > doc2      A      I      2
> > > > > >> > > > doc3      A      I      3
> > > > > >> > > > doc4      A      J      1
> > > > > >> > > > doc5      A      J      2
> > > > > >> > > > doc6      A      J      3
> > > > > >> > > > doc7      B      I      1
> > > > > >> > > >
> > > > > >> > > > SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader,
> > new
> > > > > >> > > > string[] {"f1", "f2", "f3"});
> > > > > >> > > > SimpleFacetedSearch.Hits hits = sfs.Search(query);
> > > > > >> > > >
> > > > > >> > > > foreach(Facet facet in hits.Facets){ // groupByFields from
> > > > > >> constructor
> > > > > >> > > >
> > > > > >> > > >   foreach(FacetTerm facetTerm in facet.FacetTerms){
> > > > > >> > > >
> > > > > >> > > >       WriteLine(facet.Field + facetTerm.Name +
> > > > > facetTerm.HitCount);
> > > > > >> > > >
> > > > > >> > > >   }
> > > > > >> > > >
> > > > > >> > > > }
> > > > > >> > > >
> > > > > >> > > > results in:
> > > > > >> > > > f1 - A - 6
> > > > > >> > > > f1 - B - 1
> > > > > >> > > > f2 - I - 4
> > > > > >> > > > f2 - J - 3
> > > > > >> > > > f3 - 1 - 3
> > > > > >> > > > f3 - 2 - 1
> > > > > >> > > > f3 - 3 - 3
> > > > > >> > > >
> > > > > >> > > > >> A *simple* example?
> > > > > >> > > >
> > > > > >> > > > I didn't say it's easy, the opposite..again thanks for
> your
> > > > time.
> > > > > >> > > >
> > > > > >> > > > On Wed, May 25, 2011 at 10:55 PM, Digy <
> digydigy@gmail.com>
> > > > > wrote:
> > > > > >> > > >
> > > > > >> > > > >
> > > > > >> > > > > Sorry Marco,
> > > > > >> > > > > I can't see your point. A *simple* example?
> > > > > >> > > > >
> > > > > >> > > > > DIGY
> > > > > >> > > > >
> > > > > >> > > > > -----Original Message-----
> > > > > >> > > > > From: Marco Dissel [mailto:marco.dissel@gmail.com]
> > > > > >> > > > > Sent: Wednesday, May 25, 2011 11:45 PM
> > > > > >> > > > > To: lucene-net-user@lucene.apache.org
> > > > > >> > > > > Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET
> > > without
> > > > > >> using
> > > > > >> > > the
> > > > > >> > > > > Bits-method
> > > > > >> > > > >
> > > > > >> > > > > Thank digy!
> > > > > >> > > > >
> > > > > >> > > > > The current sample is grouping the unique combinations
> of
> > > > > multiple
> > > > > >> > > facets
> > > > > >> > > > > fields, but what if you want to create an facet
> interface
> > > like
> > > > > on
> > > > > >> > this
> > > > > >> > > > > amazon.com page http://goo.gl/tBhuj ? The number of
> hits
> > > are
> > > > > >> based
> > > > > >> > on
> > > > > >> > > a
> > > > > >> > > > > single field query (click on "boxed set" will show 1148
> > > > hits)..
> > > > > >> > > > >
> > > > > >> > > > > Edition
> > > > > >> > > > >
> > > > > >> > > > >   - [image: Unselected Box]Boxed Set
> > > > > >> > > > > (1,148)<
> > > > > >> > > > >
> > > > > >>
> > > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fo
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> rmat_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=
> > > > > >> > > > > 672573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > > >> > > > >   - [image: Unselected Box]Full Screen
> > > > > >> > > > > (875)<
> > > > > >> > > > >
> > > > > >> >
> > > > >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> at_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=67
> > > > > >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > > >> > > > >   - [image: Unselected Box]Widescreen
> > > > > >> > > > > (606)<
> > > > > >> > > > >
> > > > > >> >
> > > > >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> at_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=67
> > > > > >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > > >> > > > >
> > > > > >> > > > > Region
> > > > > >> > > > >
> > > > > >> > > > >   - US & CA DVDs: Region 1
> > > > > >> > > > > (1,873)<
> > > > > >> > > > >
> > > > > >>
> > > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fe
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> ature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011
> > > > > >> > > > > &bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > > >> > > > >   - DVDs Playable Outside the US
> > > > > >> > > > > (1)<
> > > > > >> > > > >
> > > > > >> > >
> > > > > >>
> > > > >
> > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C67
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 2573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K7
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 9MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featur
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> e_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A129174
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 11%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn
> > > > > >> > > > > =672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > > >> > > > >   - DVDs Playable in any Region
> > > > > >> > > > > (62)<
> > > > > >> > > > >
> > > > > >> > >
> > > > > >>
> > > >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C6
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 72573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featu
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> re_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bb
> > > > > >> > > > > n=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > > > Thanks
> > > > > >> > > > >
> > > > > >> > > > > On Wed, May 25, 2011 at 12:08 AM, Digy <
> > digydigy@gmail.com>
> > > > > >> wrote:
> > > > > >> > > > >
> > > > > >> > > > > > 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.wu@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 <di...@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.dissel@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 <
> > > > > >> digydigy@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 <
> > > > > >> > > > > > > karunakerreddyv@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 <
> > > > > >> > > digydigy@gmail.com
> > > > > >> > > > >
> > > > > >> > > > > > > wrote:
> > > > > >> > > > > > > > > >
> > > > > >> > > > > > > > > > > Take a look at OpenBitSetDISI in
> > Lucene.Net.Util
> > > > > >> > > > > > > > > > >
> > > > > >> > > > > > > > > > > DIGY
> > > > > >> > > > > > > > > > >
> > > > > >> > > > > > > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin
> <
> > > > > >> > > > > > larsaaslin@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
> > > > > >> > > > > > > > > > > >
> > > > > >> > > > > > > > > > >
> > > > > >> > > > > > > > > >
> > > > > >> > > > > > > > >
> > > > > >> > > > > > > >
> > > > > >> > > > > > >
> > > > > >> > > > > >
> > > > > >> > > > > >
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>

---------------------------------------------------------
Disclaimer 

This message and any attachments are confidential and/or privileged. If this has been sent to you in error, please do not use, retain or disclose them, and contact the sender as soon as possible.

Oxford Analytica Ltd
Registered in England: No. 1196703
5 Alfred Street, Oxford
United Kingdom, OX1 4EH
---------------------------------------------------------


Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Marco Dissel <ma...@gmail.com>.
Nice one ;-) here's another: "Don't reinvent the wheel, just realign it."

Let me rephrase my question, will the solr implementation perform better for
a large number of facets? i don't see any bitset parts, it seems to be based
on re-querying..

Thanks

On Sat, May 28, 2011 at 12:03 AM, Digy <di...@gmail.com> wrote:

> This reminded me of the old story
>
> "About four people named Everybody, Somebody, Anybody, and Nobody.
> There was an important job to be done and Everybody was sure that Somebody
> would do it.
> Anybody could have done it, but Nobody did it.
> Somebody got angry about that because it was Everybody's job.
> Everybody thought that Anybody could do it, but Nobody realized that
> Everybody wouldn't do it.
> It ended up that Everybody blamed Somebody when Nobody did what Anybody
> could have done."
>
> :)
>
> DIGY
>
> -----Original Message-----
> From: Marco Dissel [mailto:marco.dissel@gmail.com]
> Sent: Friday, May 27, 2011 4:46 PM
> To: lucene-net-user@lucene.apache.org
> Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without using the
> Bits-method
>
> Anyone tried to convert the solr implementation?
>
> see
>
> http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/
> request/SimpleFacets.java?view=markup
>
>
> <
> http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr
> /request/SimpleFacets.java?view=markup>
>
> On Fri, May 27, 2011 at 1:09 PM, digy digy <di...@gmail.com> wrote:
>
> > I create the SFS only once and use two fields for faceting(added one more
> > field after my eMail  with 30 & 11 unique terms).
> > That is all.
> >
> > DIGY
> >
> > On Fri, May 27, 2011 at 2:00 PM, Marco Dissel <marco.dissel@gmail.com
> > >wrote:
> >
> > > Correct, but why do you get much better performance, according to a
> > > previous
> > > email?
> > >
> > > >> 30 facets, ~300K docs and 1.4GB index I get better results.(first
> > query:
> > > ~100-400 ms, if I repeat it then <10ms)
> > >
> > >
> > > On Fri, May 27, 2011 at 12:42 PM, digy digy <di...@gmail.com>
> wrote:
> > >
> > > > Suppose every field contains 20 unique terms, then you have
> 64,000,000
> > > > combinations to compute in constructor.
> > > > (I think, SFS finds only 949 of them usable(BitSets with >0
> > > cardinality)).
> > > >
> > > > DIGY
> > > >
> > > > On Fri, May 27, 2011 at 12:14 PM, Marco Dissel <
> marco.dissel@gmail.com
> > > > >wrote:
> > > >
> > > > > If I increase my number of facetfields to 6, the time to create a
> > > > > SimpleFacetedSearch instance is over ~ 10 minutes... (compiled in
> > > release
> > > > > and outside VisualStudio).. the number of HitsGroup is 949..
> > > > >
> > > > >
> > > > > On Fri, May 27, 2011 at 8:46 AM, Marco Dissel <
> > marco.dissel@gmail.com
> > > > > >wrote:
> > > > >
> > > > > > That's strange.. i'm using that version from svn
> > > > > >
> > > > > > The bold line is causing the slowness:
> > > > > >         Console.WriteLine(string.Format(" Facetsearch for
> > > > > > {0}",string.Join(",", fields)));
> > > > > >  Query query = new
> > > > > >
> > > Lucene.Net.QueryParsers.QueryParser(Lucene.Net.Util.Version.LUCENE_29,
> > > > > > "Content-Any", new
> > > > > >
> > > > >
> > > >
> > >
> >
>
> Lucene.Net.Analysis.Standard.StandardAnalyzer(Lucene.Net.Util.Version.LUCENE
> _29)).Parse(value);
> > > > > >  Console.WriteLine(string.Format("  Facetsearch for
> > > > {0}",string.Join(",",
> > > > > > fields)));
> > > > > > DateTime start = DateTime.Now;
> > > > > > * using (SimpleFacetedSearch sfs = new
> SimpleFacetedSearch(_Reader,
> > > > > > fields)) {*
> > > > > > Console.WriteLine(string.Format("  Create facetsearcher
> > > > > {0}",((DateTime.Now
> > > > > > - start).TotalSeconds)));
> > > > > >
> > > > > > The facets are calculated on a searchresult set of ~32.000 items.
> > > > > >
> > > > > >   Facetsearch for company-owner
> > > > > >   Create facetsearcher 0,0760043
> > > > > >   Search facetsearcher 0,1560089
> > > > > >   Iterate facetsearcher 0,1570089
> > > > > > 0,2640151
> > > > > >   Facetsearch for company-owner,country
> > > > > >   Create facetsearcher 0,2550146
> > > > > >   Search facetsearcher 0,6630379
> > > > > >   Iterate facetsearcher 0,6680382
> > > > > > 0,6690383
> > > > > >   Facetsearch for company-owner,country,company-category
> > > > > >   Create facetsearcher 1,1110636
> > > > > >   Search facetsearcher 1,7340992
> > > > > >   Iterate facetsearcher 1,7410996
> > > > > > 1,7410996
> > > > > >   Facetsearch for company-owner,country,company-category,language
> > > > > >   Create facetsearcher 5,0072864
> > > > > >   Search facetsearcher 6,0813479
> > > > > >   Iterate facetsearcher 6,0943486
> > > > > > 6,0963487
> > > > > >
> > > > > > On Fri, May 27, 2011 at 8:02 AM, digy digy <di...@gmail.com>
> > > wrote:
> > > > > >
> > > > > >> Indeed, I seems to be slow. With 30 facets, ~300K docs and 1.4GB
> > > index
> > > > I
> > > > > >> get
> > > > > >> better results.(first query: ~100-400 ms, if I repeat it then
> > <10ms)
> > > > > >> Do you use the code from
> > > > > >>
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> https://svn.apache.org/repos/asf/incubator/lucene.net/branches/Lucene.Net_2_
> 9_4g/src/contrib/SimpleFacetedSearch/
> > > > > >>  ?
> > > > > >>
> > > > > >> DIGY
> > > > > >>
> > > > > >>
> > > > > >> On Fri, May 27, 2011 at 12:49 AM, Marco Dissel <
> > > > marco.dissel@gmail.com
> > > > > >> >wrote:
> > > > > >>
> > > > > >> > You're are right.. It this the most optimal way of calculating
> > > > > multiple
> > > > > >> > facets?
> > > > > >> >
> > > > > >> > I get this performance result in my test:
> > > > > >> > seconds - number of facet fields
> > > > > >> > 0,2760158 - 1
> > > > > >> > 0,665038 - 2
> > > > > >> > 1,7320991 - 3
> > > > > >> > 6,0633468 - 4
> > > > > >> >
> > > > > >> > on a ~300mb index
> > > > > >> >
> > > > > >> > Ideally i want to show an user interface with much more
> facets,
> > > but
> > > > > with
> > > > > >> > these numbers it's not possible.
> > > > > >> >
> > > > > >> > On Thu, May 26, 2011 at 8:10 AM, digy digy <
> digydigy@gmail.com>
> > > > > wrote:
> > > > > >> >
> > > > > >> > > I still don't understand, since these numbers can easily be
> > > > obtained
> > > > > >> from
> > > > > >> > > current implementation.
> > > > > >> > > Just count HitsPerGroup.Name[i]' s.
> > > > > >> > >
> > > > > >> > > DIGY
> > > > > >> > >
> > > > > >> > > On Thu, May 26, 2011 at 12:21 AM, Marco Dissel <
> > > > > >> marco.dissel@gmail.com
> > > > > >> > > >wrote:
> > > > > >> > >
> > > > > >> > > > Let's take the sample data from http://goo.gl/UQubj
> > > > > >> > > >
> > > > > >> > > >          f1     f2     f3
> > > > > >> > > >          --     --     --
> > > > > >> > > > doc1      A      I      1
> > > > > >> > > > doc2      A      I      2
> > > > > >> > > > doc3      A      I      3
> > > > > >> > > > doc4      A      J      1
> > > > > >> > > > doc5      A      J      2
> > > > > >> > > > doc6      A      J      3
> > > > > >> > > > doc7      B      I      1
> > > > > >> > > >
> > > > > >> > > > SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader,
> > new
> > > > > >> > > > string[] {"f1", "f2", "f3"});
> > > > > >> > > > SimpleFacetedSearch.Hits hits = sfs.Search(query);
> > > > > >> > > >
> > > > > >> > > > foreach(Facet facet in hits.Facets){ // groupByFields from
> > > > > >> constructor
> > > > > >> > > >
> > > > > >> > > >   foreach(FacetTerm facetTerm in facet.FacetTerms){
> > > > > >> > > >
> > > > > >> > > >       WriteLine(facet.Field + facetTerm.Name +
> > > > > facetTerm.HitCount);
> > > > > >> > > >
> > > > > >> > > >   }
> > > > > >> > > >
> > > > > >> > > > }
> > > > > >> > > >
> > > > > >> > > > results in:
> > > > > >> > > > f1 - A - 6
> > > > > >> > > > f1 - B - 1
> > > > > >> > > > f2 - I - 4
> > > > > >> > > > f2 - J - 3
> > > > > >> > > > f3 - 1 - 3
> > > > > >> > > > f3 - 2 - 1
> > > > > >> > > > f3 - 3 - 3
> > > > > >> > > >
> > > > > >> > > > >> A *simple* example?
> > > > > >> > > >
> > > > > >> > > > I didn't say it's easy, the opposite..again thanks for
> your
> > > > time.
> > > > > >> > > >
> > > > > >> > > > On Wed, May 25, 2011 at 10:55 PM, Digy <
> digydigy@gmail.com>
> > > > > wrote:
> > > > > >> > > >
> > > > > >> > > > >
> > > > > >> > > > > Sorry Marco,
> > > > > >> > > > > I can't see your point. A *simple* example?
> > > > > >> > > > >
> > > > > >> > > > > DIGY
> > > > > >> > > > >
> > > > > >> > > > > -----Original Message-----
> > > > > >> > > > > From: Marco Dissel [mailto:marco.dissel@gmail.com]
> > > > > >> > > > > Sent: Wednesday, May 25, 2011 11:45 PM
> > > > > >> > > > > To: lucene-net-user@lucene.apache.org
> > > > > >> > > > > Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET
> > > without
> > > > > >> using
> > > > > >> > > the
> > > > > >> > > > > Bits-method
> > > > > >> > > > >
> > > > > >> > > > > Thank digy!
> > > > > >> > > > >
> > > > > >> > > > > The current sample is grouping the unique combinations
> of
> > > > > multiple
> > > > > >> > > facets
> > > > > >> > > > > fields, but what if you want to create an facet
> interface
> > > like
> > > > > on
> > > > > >> > this
> > > > > >> > > > > amazon.com page http://goo.gl/tBhuj ? The number of
> hits
> > > are
> > > > > >> based
> > > > > >> > on
> > > > > >> > > a
> > > > > >> > > > > single field query (click on "boxed set" will show 1148
> > > > hits)..
> > > > > >> > > > >
> > > > > >> > > > > Edition
> > > > > >> > > > >
> > > > > >> > > > >   - [image: Unselected Box]Boxed Set
> > > > > >> > > > > (1,148)<
> > > > > >> > > > >
> > > > > >>
> > > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fo
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> rmat_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=
> > > > > >> > > > > 672573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > > >> > > > >   - [image: Unselected Box]Full Screen
> > > > > >> > > > > (875)<
> > > > > >> > > > >
> > > > > >> >
> > > > >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> at_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=67
> > > > > >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > > >> > > > >   - [image: Unselected Box]Widescreen
> > > > > >> > > > > (606)<
> > > > > >> > > > >
> > > > > >> >
> > > > >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> at_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=67
> > > > > >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > > >> > > > >
> > > > > >> > > > > Region
> > > > > >> > > > >
> > > > > >> > > > >   - US & CA DVDs: Region 1
> > > > > >> > > > > (1,873)<
> > > > > >> > > > >
> > > > > >>
> > > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fe
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> ature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011
> > > > > >> > > > > &bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > > >> > > > >   - DVDs Playable Outside the US
> > > > > >> > > > > (1)<
> > > > > >> > > > >
> > > > > >> > >
> > > > > >>
> > > > >
> > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C67
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 2573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K7
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 9MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featur
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> e_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A129174
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 11%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn
> > > > > >> > > > > =672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > > >> > > > >   - DVDs Playable in any Region
> > > > > >> > > > > (62)<
> > > > > >> > > > >
> > > > > >> > >
> > > > > >>
> > > >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C6
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 72573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featu
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> re_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
>
> 411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bb
> > > > > >> > > > > n=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > > > Thanks
> > > > > >> > > > >
> > > > > >> > > > > On Wed, May 25, 2011 at 12:08 AM, Digy <
> > digydigy@gmail.com>
> > > > > >> wrote:
> > > > > >> > > > >
> > > > > >> > > > > > 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.wu@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 <di...@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.dissel@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 <
> > > > > >> digydigy@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 <
> > > > > >> > > > > > > karunakerreddyv@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 <
> > > > > >> > > digydigy@gmail.com
> > > > > >> > > > >
> > > > > >> > > > > > > wrote:
> > > > > >> > > > > > > > > >
> > > > > >> > > > > > > > > > > Take a look at OpenBitSetDISI in
> > Lucene.Net.Util
> > > > > >> > > > > > > > > > >
> > > > > >> > > > > > > > > > > DIGY
> > > > > >> > > > > > > > > > >
> > > > > >> > > > > > > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin
> <
> > > > > >> > > > > > larsaaslin@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
> > > > > >> > > > > > > > > > > >
> > > > > >> > > > > > > > > > >
> > > > > >> > > > > > > > > >
> > > > > >> > > > > > > > >
> > > > > >> > > > > > > >
> > > > > >> > > > > > >
> > > > > >> > > > > >
> > > > > >> > > > > >
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>

RE: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Digy <di...@gmail.com>.
This reminded me of the old story 

"About four people named Everybody, Somebody, Anybody, and Nobody.
There was an important job to be done and Everybody was sure that Somebody
would do it.
Anybody could have done it, but Nobody did it.
Somebody got angry about that because it was Everybody's job.
Everybody thought that Anybody could do it, but Nobody realized that
Everybody wouldn't do it.
It ended up that Everybody blamed Somebody when Nobody did what Anybody
could have done."

:)

DIGY

-----Original Message-----
From: Marco Dissel [mailto:marco.dissel@gmail.com] 
Sent: Friday, May 27, 2011 4:46 PM
To: lucene-net-user@lucene.apache.org
Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without using the
Bits-method

Anyone tried to convert the solr implementation?

see
http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/
request/SimpleFacets.java?view=markup


<http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr
/request/SimpleFacets.java?view=markup>

On Fri, May 27, 2011 at 1:09 PM, digy digy <di...@gmail.com> wrote:

> I create the SFS only once and use two fields for faceting(added one more
> field after my eMail  with 30 & 11 unique terms).
> That is all.
>
> DIGY
>
> On Fri, May 27, 2011 at 2:00 PM, Marco Dissel <marco.dissel@gmail.com
> >wrote:
>
> > Correct, but why do you get much better performance, according to a
> > previous
> > email?
> >
> > >> 30 facets, ~300K docs and 1.4GB index I get better results.(first
> query:
> > ~100-400 ms, if I repeat it then <10ms)
> >
> >
> > On Fri, May 27, 2011 at 12:42 PM, digy digy <di...@gmail.com> wrote:
> >
> > > Suppose every field contains 20 unique terms, then you have 64,000,000
> > > combinations to compute in constructor.
> > > (I think, SFS finds only 949 of them usable(BitSets with >0
> > cardinality)).
> > >
> > > DIGY
> > >
> > > On Fri, May 27, 2011 at 12:14 PM, Marco Dissel <marco.dissel@gmail.com
> > > >wrote:
> > >
> > > > If I increase my number of facetfields to 6, the time to create a
> > > > SimpleFacetedSearch instance is over ~ 10 minutes... (compiled in
> > release
> > > > and outside VisualStudio).. the number of HitsGroup is 949..
> > > >
> > > >
> > > > On Fri, May 27, 2011 at 8:46 AM, Marco Dissel <
> marco.dissel@gmail.com
> > > > >wrote:
> > > >
> > > > > That's strange.. i'm using that version from svn
> > > > >
> > > > > The bold line is causing the slowness:
> > > > >         Console.WriteLine(string.Format(" Facetsearch for
> > > > > {0}",string.Join(",", fields)));
> > > > >  Query query = new
> > > > >
> > Lucene.Net.QueryParsers.QueryParser(Lucene.Net.Util.Version.LUCENE_29,
> > > > > "Content-Any", new
> > > > >
> > > >
> > >
> >
>
Lucene.Net.Analysis.Standard.StandardAnalyzer(Lucene.Net.Util.Version.LUCENE
_29)).Parse(value);
> > > > >  Console.WriteLine(string.Format("  Facetsearch for
> > > {0}",string.Join(",",
> > > > > fields)));
> > > > > DateTime start = DateTime.Now;
> > > > > * using (SimpleFacetedSearch sfs = new
SimpleFacetedSearch(_Reader,
> > > > > fields)) {*
> > > > > Console.WriteLine(string.Format("  Create facetsearcher
> > > > {0}",((DateTime.Now
> > > > > - start).TotalSeconds)));
> > > > >
> > > > > The facets are calculated on a searchresult set of ~32.000 items.
> > > > >
> > > > >   Facetsearch for company-owner
> > > > >   Create facetsearcher 0,0760043
> > > > >   Search facetsearcher 0,1560089
> > > > >   Iterate facetsearcher 0,1570089
> > > > > 0,2640151
> > > > >   Facetsearch for company-owner,country
> > > > >   Create facetsearcher 0,2550146
> > > > >   Search facetsearcher 0,6630379
> > > > >   Iterate facetsearcher 0,6680382
> > > > > 0,6690383
> > > > >   Facetsearch for company-owner,country,company-category
> > > > >   Create facetsearcher 1,1110636
> > > > >   Search facetsearcher 1,7340992
> > > > >   Iterate facetsearcher 1,7410996
> > > > > 1,7410996
> > > > >   Facetsearch for company-owner,country,company-category,language
> > > > >   Create facetsearcher 5,0072864
> > > > >   Search facetsearcher 6,0813479
> > > > >   Iterate facetsearcher 6,0943486
> > > > > 6,0963487
> > > > >
> > > > > On Fri, May 27, 2011 at 8:02 AM, digy digy <di...@gmail.com>
> > wrote:
> > > > >
> > > > >> Indeed, I seems to be slow. With 30 facets, ~300K docs and 1.4GB
> > index
> > > I
> > > > >> get
> > > > >> better results.(first query: ~100-400 ms, if I repeat it then
> <10ms)
> > > > >> Do you use the code from
> > > > >>
> > > > >>
> > > >
> > >
> >
>
https://svn.apache.org/repos/asf/incubator/lucene.net/branches/Lucene.Net_2_
9_4g/src/contrib/SimpleFacetedSearch/
> > > > >>  ?
> > > > >>
> > > > >> DIGY
> > > > >>
> > > > >>
> > > > >> On Fri, May 27, 2011 at 12:49 AM, Marco Dissel <
> > > marco.dissel@gmail.com
> > > > >> >wrote:
> > > > >>
> > > > >> > You're are right.. It this the most optimal way of calculating
> > > > multiple
> > > > >> > facets?
> > > > >> >
> > > > >> > I get this performance result in my test:
> > > > >> > seconds - number of facet fields
> > > > >> > 0,2760158 - 1
> > > > >> > 0,665038 - 2
> > > > >> > 1,7320991 - 3
> > > > >> > 6,0633468 - 4
> > > > >> >
> > > > >> > on a ~300mb index
> > > > >> >
> > > > >> > Ideally i want to show an user interface with much more facets,
> > but
> > > > with
> > > > >> > these numbers it's not possible.
> > > > >> >
> > > > >> > On Thu, May 26, 2011 at 8:10 AM, digy digy <di...@gmail.com>
> > > > wrote:
> > > > >> >
> > > > >> > > I still don't understand, since these numbers can easily be
> > > obtained
> > > > >> from
> > > > >> > > current implementation.
> > > > >> > > Just count HitsPerGroup.Name[i]' s.
> > > > >> > >
> > > > >> > > DIGY
> > > > >> > >
> > > > >> > > On Thu, May 26, 2011 at 12:21 AM, Marco Dissel <
> > > > >> marco.dissel@gmail.com
> > > > >> > > >wrote:
> > > > >> > >
> > > > >> > > > Let's take the sample data from http://goo.gl/UQubj
> > > > >> > > >
> > > > >> > > >          f1     f2     f3
> > > > >> > > >          --     --     --
> > > > >> > > > doc1      A      I      1
> > > > >> > > > doc2      A      I      2
> > > > >> > > > doc3      A      I      3
> > > > >> > > > doc4      A      J      1
> > > > >> > > > doc5      A      J      2
> > > > >> > > > doc6      A      J      3
> > > > >> > > > doc7      B      I      1
> > > > >> > > >
> > > > >> > > > SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader,
> new
> > > > >> > > > string[] {"f1", "f2", "f3"});
> > > > >> > > > SimpleFacetedSearch.Hits hits = sfs.Search(query);
> > > > >> > > >
> > > > >> > > > foreach(Facet facet in hits.Facets){ // groupByFields from
> > > > >> constructor
> > > > >> > > >
> > > > >> > > >   foreach(FacetTerm facetTerm in facet.FacetTerms){
> > > > >> > > >
> > > > >> > > >       WriteLine(facet.Field + facetTerm.Name +
> > > > facetTerm.HitCount);
> > > > >> > > >
> > > > >> > > >   }
> > > > >> > > >
> > > > >> > > > }
> > > > >> > > >
> > > > >> > > > results in:
> > > > >> > > > f1 - A - 6
> > > > >> > > > f1 - B - 1
> > > > >> > > > f2 - I - 4
> > > > >> > > > f2 - J - 3
> > > > >> > > > f3 - 1 - 3
> > > > >> > > > f3 - 2 - 1
> > > > >> > > > f3 - 3 - 3
> > > > >> > > >
> > > > >> > > > >> A *simple* example?
> > > > >> > > >
> > > > >> > > > I didn't say it's easy, the opposite..again thanks for your
> > > time.
> > > > >> > > >
> > > > >> > > > On Wed, May 25, 2011 at 10:55 PM, Digy <di...@gmail.com>
> > > > wrote:
> > > > >> > > >
> > > > >> > > > >
> > > > >> > > > > Sorry Marco,
> > > > >> > > > > I can't see your point. A *simple* example?
> > > > >> > > > >
> > > > >> > > > > DIGY
> > > > >> > > > >
> > > > >> > > > > -----Original Message-----
> > > > >> > > > > From: Marco Dissel [mailto:marco.dissel@gmail.com]
> > > > >> > > > > Sent: Wednesday, May 25, 2011 11:45 PM
> > > > >> > > > > To: lucene-net-user@lucene.apache.org
> > > > >> > > > > Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET
> > without
> > > > >> using
> > > > >> > > the
> > > > >> > > > > Bits-method
> > > > >> > > > >
> > > > >> > > > > Thank digy!
> > > > >> > > > >
> > > > >> > > > > The current sample is grouping the unique combinations of
> > > > multiple
> > > > >> > > facets
> > > > >> > > > > fields, but what if you want to create an facet interface
> > like
> > > > on
> > > > >> > this
> > > > >> > > > > amazon.com page http://goo.gl/tBhuj ? The number of hits
> > are
> > > > >> based
> > > > >> > on
> > > > >> > > a
> > > > >> > > > > single field query (click on "boxed set" will show 1148
> > > hits)..
> > > > >> > > > >
> > > > >> > > > > Edition
> > > > >> > > > >
> > > > >> > > > >   - [image: Unselected Box]Boxed Set
> > > > >> > > > > (1,148)<
> > > > >> > > > >
> > > > >>
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fo
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
rmat_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=
> > > > >> > > > > 672573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > >> > > > >   - [image: Unselected Box]Full Screen
> > > > >> > > > > (875)<
> > > > >> > > > >
> > > > >> >
> > > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
at_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=67
> > > > >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > >> > > > >   - [image: Unselected Box]Widescreen
> > > > >> > > > > (606)<
> > > > >> > > > >
> > > > >> >
> > > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
at_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=67
> > > > >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > >> > > > >
> > > > >> > > > > Region
> > > > >> > > > >
> > > > >> > > > >   - US & CA DVDs: Region 1
> > > > >> > > > > (1,873)<
> > > > >> > > > >
> > > > >>
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fe
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
ature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011
> > > > >> > > > > &bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > >> > > > >   - DVDs Playable Outside the US
> > > > >> > > > > (1)<
> > > > >> > > > >
> > > > >> > >
> > > > >>
> > > >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C67
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
2573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K7
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
9MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featur
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
e_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A129174
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
11%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn
> > > > >> > > > > =672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > >> > > > >   - DVDs Playable in any Region
> > > > >> > > > > (62)<
> > > > >> > > > >
> > > > >> > >
> > > > >>
> > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C6
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
72573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featu
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
re_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
>
411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bb
> > > > >> > > > > n=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > > > Thanks
> > > > >> > > > >
> > > > >> > > > > On Wed, May 25, 2011 at 12:08 AM, Digy <
> digydigy@gmail.com>
> > > > >> wrote:
> > > > >> > > > >
> > > > >> > > > > > 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.wu@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 <di...@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.dissel@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 <
> > > > >> digydigy@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 <
> > > > >> > > > > > > karunakerreddyv@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 <
> > > > >> > > digydigy@gmail.com
> > > > >> > > > >
> > > > >> > > > > > > wrote:
> > > > >> > > > > > > > > >
> > > > >> > > > > > > > > > > Take a look at OpenBitSetDISI in
> Lucene.Net.Util
> > > > >> > > > > > > > > > >
> > > > >> > > > > > > > > > > DIGY
> > > > >> > > > > > > > > > >
> > > > >> > > > > > > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin
<
> > > > >> > > > > > larsaaslin@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
> > > > >> > > > > > > > > > > >
> > > > >> > > > > > > > > > >
> > > > >> > > > > > > > > >
> > > > >> > > > > > > > >
> > > > >> > > > > > > >
> > > > >> > > > > > >
> > > > >> > > > > >
> > > > >> > > > > >
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > > >
> > > > >
> > > >
> > >
> >
>


Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Marco Dissel <ma...@gmail.com>.
Anyone tried to convert the solr implementation?

see
http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/request/SimpleFacets.java?view=markup


<http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/request/SimpleFacets.java?view=markup>

On Fri, May 27, 2011 at 1:09 PM, digy digy <di...@gmail.com> wrote:

> I create the SFS only once and use two fields for faceting(added one more
> field after my eMail  with 30 & 11 unique terms).
> That is all.
>
> DIGY
>
> On Fri, May 27, 2011 at 2:00 PM, Marco Dissel <marco.dissel@gmail.com
> >wrote:
>
> > Correct, but why do you get much better performance, according to a
> > previous
> > email?
> >
> > >> 30 facets, ~300K docs and 1.4GB index I get better results.(first
> query:
> > ~100-400 ms, if I repeat it then <10ms)
> >
> >
> > On Fri, May 27, 2011 at 12:42 PM, digy digy <di...@gmail.com> wrote:
> >
> > > Suppose every field contains 20 unique terms, then you have 64,000,000
> > > combinations to compute in constructor.
> > > (I think, SFS finds only 949 of them usable(BitSets with >0
> > cardinality)).
> > >
> > > DIGY
> > >
> > > On Fri, May 27, 2011 at 12:14 PM, Marco Dissel <marco.dissel@gmail.com
> > > >wrote:
> > >
> > > > If I increase my number of facetfields to 6, the time to create a
> > > > SimpleFacetedSearch instance is over ~ 10 minutes... (compiled in
> > release
> > > > and outside VisualStudio).. the number of HitsGroup is 949..
> > > >
> > > >
> > > > On Fri, May 27, 2011 at 8:46 AM, Marco Dissel <
> marco.dissel@gmail.com
> > > > >wrote:
> > > >
> > > > > That's strange.. i'm using that version from svn
> > > > >
> > > > > The bold line is causing the slowness:
> > > > >         Console.WriteLine(string.Format(" Facetsearch for
> > > > > {0}",string.Join(",", fields)));
> > > > >  Query query = new
> > > > >
> > Lucene.Net.QueryParsers.QueryParser(Lucene.Net.Util.Version.LUCENE_29,
> > > > > "Content-Any", new
> > > > >
> > > >
> > >
> >
> Lucene.Net.Analysis.Standard.StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29)).Parse(value);
> > > > >  Console.WriteLine(string.Format("  Facetsearch for
> > > {0}",string.Join(",",
> > > > > fields)));
> > > > > DateTime start = DateTime.Now;
> > > > > * using (SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader,
> > > > > fields)) {*
> > > > > Console.WriteLine(string.Format("  Create facetsearcher
> > > > {0}",((DateTime.Now
> > > > > - start).TotalSeconds)));
> > > > >
> > > > > The facets are calculated on a searchresult set of ~32.000 items.
> > > > >
> > > > >   Facetsearch for company-owner
> > > > >   Create facetsearcher 0,0760043
> > > > >   Search facetsearcher 0,1560089
> > > > >   Iterate facetsearcher 0,1570089
> > > > > 0,2640151
> > > > >   Facetsearch for company-owner,country
> > > > >   Create facetsearcher 0,2550146
> > > > >   Search facetsearcher 0,6630379
> > > > >   Iterate facetsearcher 0,6680382
> > > > > 0,6690383
> > > > >   Facetsearch for company-owner,country,company-category
> > > > >   Create facetsearcher 1,1110636
> > > > >   Search facetsearcher 1,7340992
> > > > >   Iterate facetsearcher 1,7410996
> > > > > 1,7410996
> > > > >   Facetsearch for company-owner,country,company-category,language
> > > > >   Create facetsearcher 5,0072864
> > > > >   Search facetsearcher 6,0813479
> > > > >   Iterate facetsearcher 6,0943486
> > > > > 6,0963487
> > > > >
> > > > > On Fri, May 27, 2011 at 8:02 AM, digy digy <di...@gmail.com>
> > wrote:
> > > > >
> > > > >> Indeed, I seems to be slow. With 30 facets, ~300K docs and 1.4GB
> > index
> > > I
> > > > >> get
> > > > >> better results.(first query: ~100-400 ms, if I repeat it then
> <10ms)
> > > > >> Do you use the code from
> > > > >>
> > > > >>
> > > >
> > >
> >
> https://svn.apache.org/repos/asf/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/SimpleFacetedSearch/
> > > > >>  ?
> > > > >>
> > > > >> DIGY
> > > > >>
> > > > >>
> > > > >> On Fri, May 27, 2011 at 12:49 AM, Marco Dissel <
> > > marco.dissel@gmail.com
> > > > >> >wrote:
> > > > >>
> > > > >> > You're are right.. It this the most optimal way of calculating
> > > > multiple
> > > > >> > facets?
> > > > >> >
> > > > >> > I get this performance result in my test:
> > > > >> > seconds - number of facet fields
> > > > >> > 0,2760158 - 1
> > > > >> > 0,665038 - 2
> > > > >> > 1,7320991 - 3
> > > > >> > 6,0633468 - 4
> > > > >> >
> > > > >> > on a ~300mb index
> > > > >> >
> > > > >> > Ideally i want to show an user interface with much more facets,
> > but
> > > > with
> > > > >> > these numbers it's not possible.
> > > > >> >
> > > > >> > On Thu, May 26, 2011 at 8:10 AM, digy digy <di...@gmail.com>
> > > > wrote:
> > > > >> >
> > > > >> > > I still don't understand, since these numbers can easily be
> > > obtained
> > > > >> from
> > > > >> > > current implementation.
> > > > >> > > Just count HitsPerGroup.Name[i]' s.
> > > > >> > >
> > > > >> > > DIGY
> > > > >> > >
> > > > >> > > On Thu, May 26, 2011 at 12:21 AM, Marco Dissel <
> > > > >> marco.dissel@gmail.com
> > > > >> > > >wrote:
> > > > >> > >
> > > > >> > > > Let's take the sample data from http://goo.gl/UQubj
> > > > >> > > >
> > > > >> > > >          f1     f2     f3
> > > > >> > > >          --     --     --
> > > > >> > > > doc1      A      I      1
> > > > >> > > > doc2      A      I      2
> > > > >> > > > doc3      A      I      3
> > > > >> > > > doc4      A      J      1
> > > > >> > > > doc5      A      J      2
> > > > >> > > > doc6      A      J      3
> > > > >> > > > doc7      B      I      1
> > > > >> > > >
> > > > >> > > > SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader,
> new
> > > > >> > > > string[] {"f1", "f2", "f3"});
> > > > >> > > > SimpleFacetedSearch.Hits hits = sfs.Search(query);
> > > > >> > > >
> > > > >> > > > foreach(Facet facet in hits.Facets){ // groupByFields from
> > > > >> constructor
> > > > >> > > >
> > > > >> > > >   foreach(FacetTerm facetTerm in facet.FacetTerms){
> > > > >> > > >
> > > > >> > > >       WriteLine(facet.Field + facetTerm.Name +
> > > > facetTerm.HitCount);
> > > > >> > > >
> > > > >> > > >   }
> > > > >> > > >
> > > > >> > > > }
> > > > >> > > >
> > > > >> > > > results in:
> > > > >> > > > f1 - A - 6
> > > > >> > > > f1 - B - 1
> > > > >> > > > f2 - I - 4
> > > > >> > > > f2 - J - 3
> > > > >> > > > f3 - 1 - 3
> > > > >> > > > f3 - 2 - 1
> > > > >> > > > f3 - 3 - 3
> > > > >> > > >
> > > > >> > > > >> A *simple* example?
> > > > >> > > >
> > > > >> > > > I didn't say it's easy, the opposite..again thanks for your
> > > time.
> > > > >> > > >
> > > > >> > > > On Wed, May 25, 2011 at 10:55 PM, Digy <di...@gmail.com>
> > > > wrote:
> > > > >> > > >
> > > > >> > > > >
> > > > >> > > > > Sorry Marco,
> > > > >> > > > > I can't see your point. A *simple* example?
> > > > >> > > > >
> > > > >> > > > > DIGY
> > > > >> > > > >
> > > > >> > > > > -----Original Message-----
> > > > >> > > > > From: Marco Dissel [mailto:marco.dissel@gmail.com]
> > > > >> > > > > Sent: Wednesday, May 25, 2011 11:45 PM
> > > > >> > > > > To: lucene-net-user@lucene.apache.org
> > > > >> > > > > Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET
> > without
> > > > >> using
> > > > >> > > the
> > > > >> > > > > Bits-method
> > > > >> > > > >
> > > > >> > > > > Thank digy!
> > > > >> > > > >
> > > > >> > > > > The current sample is grouping the unique combinations of
> > > > multiple
> > > > >> > > facets
> > > > >> > > > > fields, but what if you want to create an facet interface
> > like
> > > > on
> > > > >> > this
> > > > >> > > > > amazon.com page http://goo.gl/tBhuj ? The number of hits
> > are
> > > > >> based
> > > > >> > on
> > > > >> > > a
> > > > >> > > > > single field query (click on "boxed set" will show 1148
> > > hits)..
> > > > >> > > > >
> > > > >> > > > > Edition
> > > > >> > > > >
> > > > >> > > > >   - [image: Unselected Box]Boxed Set
> > > > >> > > > > (1,148)<
> > > > >> > > > >
> > > > >>
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fo
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> rmat_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=
> > > > >> > > > > 672573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > >> > > > >   - [image: Unselected Box]Full Screen
> > > > >> > > > > (875)<
> > > > >> > > > >
> > > > >> >
> > > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> at_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=67
> > > > >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > >> > > > >   - [image: Unselected Box]Widescreen
> > > > >> > > > > (606)<
> > > > >> > > > >
> > > > >> >
> > > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> at_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=67
> > > > >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > >> > > > >
> > > > >> > > > > Region
> > > > >> > > > >
> > > > >> > > > >   - US & CA DVDs: Region 1
> > > > >> > > > > (1,873)<
> > > > >> > > > >
> > > > >>
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fe
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> ature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011
> > > > >> > > > > &bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > >> > > > >   - DVDs Playable Outside the US
> > > > >> > > > > (1)<
> > > > >> > > > >
> > > > >> > >
> > > > >>
> > > >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C67
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 2573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K7
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 9MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featur
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> e_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A129174
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 11%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn
> > > > >> > > > > =672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > >> > > > >   - DVDs Playable in any Region
> > > > >> > > > > (62)<
> > > > >> > > > >
> > > > >> > >
> > > > >>
> > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C6
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 72573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featu
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> re_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> 411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bb
> > > > >> > > > > n=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > > > Thanks
> > > > >> > > > >
> > > > >> > > > > On Wed, May 25, 2011 at 12:08 AM, Digy <
> digydigy@gmail.com>
> > > > >> wrote:
> > > > >> > > > >
> > > > >> > > > > > 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.wu@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 <di...@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.dissel@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 <
> > > > >> digydigy@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 <
> > > > >> > > > > > > karunakerreddyv@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 <
> > > > >> > > digydigy@gmail.com
> > > > >> > > > >
> > > > >> > > > > > > wrote:
> > > > >> > > > > > > > > >
> > > > >> > > > > > > > > > > Take a look at OpenBitSetDISI in
> Lucene.Net.Util
> > > > >> > > > > > > > > > >
> > > > >> > > > > > > > > > > DIGY
> > > > >> > > > > > > > > > >
> > > > >> > > > > > > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> > > > >> > > > > > larsaaslin@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
> > > > >> > > > > > > > > > > >
> > > > >> > > > > > > > > > >
> > > > >> > > > > > > > > >
> > > > >> > > > > > > > >
> > > > >> > > > > > > >
> > > > >> > > > > > >
> > > > >> > > > > >
> > > > >> > > > > >
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by digy digy <di...@gmail.com>.
I create the SFS only once and use two fields for faceting(added one more
field after my eMail  with 30 & 11 unique terms).
That is all.

DIGY

On Fri, May 27, 2011 at 2:00 PM, Marco Dissel <ma...@gmail.com>wrote:

> Correct, but why do you get much better performance, according to a
> previous
> email?
>
> >> 30 facets, ~300K docs and 1.4GB index I get better results.(first query:
> ~100-400 ms, if I repeat it then <10ms)
>
>
> On Fri, May 27, 2011 at 12:42 PM, digy digy <di...@gmail.com> wrote:
>
> > Suppose every field contains 20 unique terms, then you have 64,000,000
> > combinations to compute in constructor.
> > (I think, SFS finds only 949 of them usable(BitSets with >0
> cardinality)).
> >
> > DIGY
> >
> > On Fri, May 27, 2011 at 12:14 PM, Marco Dissel <marco.dissel@gmail.com
> > >wrote:
> >
> > > If I increase my number of facetfields to 6, the time to create a
> > > SimpleFacetedSearch instance is over ~ 10 minutes... (compiled in
> release
> > > and outside VisualStudio).. the number of HitsGroup is 949..
> > >
> > >
> > > On Fri, May 27, 2011 at 8:46 AM, Marco Dissel <marco.dissel@gmail.com
> > > >wrote:
> > >
> > > > That's strange.. i'm using that version from svn
> > > >
> > > > The bold line is causing the slowness:
> > > >         Console.WriteLine(string.Format(" Facetsearch for
> > > > {0}",string.Join(",", fields)));
> > > >  Query query = new
> > > >
> Lucene.Net.QueryParsers.QueryParser(Lucene.Net.Util.Version.LUCENE_29,
> > > > "Content-Any", new
> > > >
> > >
> >
> Lucene.Net.Analysis.Standard.StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29)).Parse(value);
> > > >  Console.WriteLine(string.Format("  Facetsearch for
> > {0}",string.Join(",",
> > > > fields)));
> > > > DateTime start = DateTime.Now;
> > > > * using (SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader,
> > > > fields)) {*
> > > > Console.WriteLine(string.Format("  Create facetsearcher
> > > {0}",((DateTime.Now
> > > > - start).TotalSeconds)));
> > > >
> > > > The facets are calculated on a searchresult set of ~32.000 items.
> > > >
> > > >   Facetsearch for company-owner
> > > >   Create facetsearcher 0,0760043
> > > >   Search facetsearcher 0,1560089
> > > >   Iterate facetsearcher 0,1570089
> > > > 0,2640151
> > > >   Facetsearch for company-owner,country
> > > >   Create facetsearcher 0,2550146
> > > >   Search facetsearcher 0,6630379
> > > >   Iterate facetsearcher 0,6680382
> > > > 0,6690383
> > > >   Facetsearch for company-owner,country,company-category
> > > >   Create facetsearcher 1,1110636
> > > >   Search facetsearcher 1,7340992
> > > >   Iterate facetsearcher 1,7410996
> > > > 1,7410996
> > > >   Facetsearch for company-owner,country,company-category,language
> > > >   Create facetsearcher 5,0072864
> > > >   Search facetsearcher 6,0813479
> > > >   Iterate facetsearcher 6,0943486
> > > > 6,0963487
> > > >
> > > > On Fri, May 27, 2011 at 8:02 AM, digy digy <di...@gmail.com>
> wrote:
> > > >
> > > >> Indeed, I seems to be slow. With 30 facets, ~300K docs and 1.4GB
> index
> > I
> > > >> get
> > > >> better results.(first query: ~100-400 ms, if I repeat it then <10ms)
> > > >> Do you use the code from
> > > >>
> > > >>
> > >
> >
> https://svn.apache.org/repos/asf/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/SimpleFacetedSearch/
> > > >>  ?
> > > >>
> > > >> DIGY
> > > >>
> > > >>
> > > >> On Fri, May 27, 2011 at 12:49 AM, Marco Dissel <
> > marco.dissel@gmail.com
> > > >> >wrote:
> > > >>
> > > >> > You're are right.. It this the most optimal way of calculating
> > > multiple
> > > >> > facets?
> > > >> >
> > > >> > I get this performance result in my test:
> > > >> > seconds - number of facet fields
> > > >> > 0,2760158 - 1
> > > >> > 0,665038 - 2
> > > >> > 1,7320991 - 3
> > > >> > 6,0633468 - 4
> > > >> >
> > > >> > on a ~300mb index
> > > >> >
> > > >> > Ideally i want to show an user interface with much more facets,
> but
> > > with
> > > >> > these numbers it's not possible.
> > > >> >
> > > >> > On Thu, May 26, 2011 at 8:10 AM, digy digy <di...@gmail.com>
> > > wrote:
> > > >> >
> > > >> > > I still don't understand, since these numbers can easily be
> > obtained
> > > >> from
> > > >> > > current implementation.
> > > >> > > Just count HitsPerGroup.Name[i]' s.
> > > >> > >
> > > >> > > DIGY
> > > >> > >
> > > >> > > On Thu, May 26, 2011 at 12:21 AM, Marco Dissel <
> > > >> marco.dissel@gmail.com
> > > >> > > >wrote:
> > > >> > >
> > > >> > > > Let's take the sample data from http://goo.gl/UQubj
> > > >> > > >
> > > >> > > >          f1     f2     f3
> > > >> > > >          --     --     --
> > > >> > > > doc1      A      I      1
> > > >> > > > doc2      A      I      2
> > > >> > > > doc3      A      I      3
> > > >> > > > doc4      A      J      1
> > > >> > > > doc5      A      J      2
> > > >> > > > doc6      A      J      3
> > > >> > > > doc7      B      I      1
> > > >> > > >
> > > >> > > > SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader, new
> > > >> > > > string[] {"f1", "f2", "f3"});
> > > >> > > > SimpleFacetedSearch.Hits hits = sfs.Search(query);
> > > >> > > >
> > > >> > > > foreach(Facet facet in hits.Facets){ // groupByFields from
> > > >> constructor
> > > >> > > >
> > > >> > > >   foreach(FacetTerm facetTerm in facet.FacetTerms){
> > > >> > > >
> > > >> > > >       WriteLine(facet.Field + facetTerm.Name +
> > > facetTerm.HitCount);
> > > >> > > >
> > > >> > > >   }
> > > >> > > >
> > > >> > > > }
> > > >> > > >
> > > >> > > > results in:
> > > >> > > > f1 - A - 6
> > > >> > > > f1 - B - 1
> > > >> > > > f2 - I - 4
> > > >> > > > f2 - J - 3
> > > >> > > > f3 - 1 - 3
> > > >> > > > f3 - 2 - 1
> > > >> > > > f3 - 3 - 3
> > > >> > > >
> > > >> > > > >> A *simple* example?
> > > >> > > >
> > > >> > > > I didn't say it's easy, the opposite..again thanks for your
> > time.
> > > >> > > >
> > > >> > > > On Wed, May 25, 2011 at 10:55 PM, Digy <di...@gmail.com>
> > > wrote:
> > > >> > > >
> > > >> > > > >
> > > >> > > > > Sorry Marco,
> > > >> > > > > I can't see your point. A *simple* example?
> > > >> > > > >
> > > >> > > > > DIGY
> > > >> > > > >
> > > >> > > > > -----Original Message-----
> > > >> > > > > From: Marco Dissel [mailto:marco.dissel@gmail.com]
> > > >> > > > > Sent: Wednesday, May 25, 2011 11:45 PM
> > > >> > > > > To: lucene-net-user@lucene.apache.org
> > > >> > > > > Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET
> without
> > > >> using
> > > >> > > the
> > > >> > > > > Bits-method
> > > >> > > > >
> > > >> > > > > Thank digy!
> > > >> > > > >
> > > >> > > > > The current sample is grouping the unique combinations of
> > > multiple
> > > >> > > facets
> > > >> > > > > fields, but what if you want to create an facet interface
> like
> > > on
> > > >> > this
> > > >> > > > > amazon.com page http://goo.gl/tBhuj ? The number of hits
> are
> > > >> based
> > > >> > on
> > > >> > > a
> > > >> > > > > single field query (click on "boxed set" will show 1148
> > hits)..
> > > >> > > > >
> > > >> > > > > Edition
> > > >> > > > >
> > > >> > > > >   - [image: Unselected Box]Boxed Set
> > > >> > > > > (1,148)<
> > > >> > > > >
> > > >>
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fo
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> rmat_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=
> > > >> > > > > 672573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > >> > > > >   - [image: Unselected Box]Full Screen
> > > >> > > > > (875)<
> > > >> > > > >
> > > >> >
> > > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> at_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=67
> > > >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > >> > > > >   - [image: Unselected Box]Widescreen
> > > >> > > > > (606)<
> > > >> > > > >
> > > >> >
> > > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> at_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=67
> > > >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > >> > > > >
> > > >> > > > > Region
> > > >> > > > >
> > > >> > > > >   - US & CA DVDs: Region 1
> > > >> > > > > (1,873)<
> > > >> > > > >
> > > >>
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fe
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> ature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011
> > > >> > > > > &bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > >> > > > >   - DVDs Playable Outside the US
> > > >> > > > > (1)<
> > > >> > > > >
> > > >> > >
> > > >>
> > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C67
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 2573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K7
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 9MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featur
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> e_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A129174
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 11%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn
> > > >> > > > > =672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > >> > > > >   - DVDs Playable in any Region
> > > >> > > > > (62)<
> > > >> > > > >
> > > >> > >
> > > >>
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C6
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 72573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featu
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> re_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> 411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bb
> > > >> > > > > n=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > >> > > > >
> > > >> > > > >
> > > >> > > > > Thanks
> > > >> > > > >
> > > >> > > > > On Wed, May 25, 2011 at 12:08 AM, Digy <di...@gmail.com>
> > > >> wrote:
> > > >> > > > >
> > > >> > > > > > 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.wu@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 <di...@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.dissel@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 <
> > > >> digydigy@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 <
> > > >> > > > > > > karunakerreddyv@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 <
> > > >> > > digydigy@gmail.com
> > > >> > > > >
> > > >> > > > > > > wrote:
> > > >> > > > > > > > > >
> > > >> > > > > > > > > > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > > >> > > > > > > > > > >
> > > >> > > > > > > > > > > DIGY
> > > >> > > > > > > > > > >
> > > >> > > > > > > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> > > >> > > > > > larsaaslin@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
> > > >> > > > > > > > > > > >
> > > >> > > > > > > > > > >
> > > >> > > > > > > > > >
> > > >> > > > > > > > >
> > > >> > > > > > > >
> > > >> > > > > > >
> > > >> > > > > >
> > > >> > > > > >
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > > >
> > > >
> > >
> >
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Marco Dissel <ma...@gmail.com>.
Correct, but why do you get much better performance, according to a previous
email?

>> 30 facets, ~300K docs and 1.4GB index I get better results.(first query:
~100-400 ms, if I repeat it then <10ms)


On Fri, May 27, 2011 at 12:42 PM, digy digy <di...@gmail.com> wrote:

> Suppose every field contains 20 unique terms, then you have 64,000,000
> combinations to compute in constructor.
> (I think, SFS finds only 949 of them usable(BitSets with >0 cardinality)).
>
> DIGY
>
> On Fri, May 27, 2011 at 12:14 PM, Marco Dissel <marco.dissel@gmail.com
> >wrote:
>
> > If I increase my number of facetfields to 6, the time to create a
> > SimpleFacetedSearch instance is over ~ 10 minutes... (compiled in release
> > and outside VisualStudio).. the number of HitsGroup is 949..
> >
> >
> > On Fri, May 27, 2011 at 8:46 AM, Marco Dissel <marco.dissel@gmail.com
> > >wrote:
> >
> > > That's strange.. i'm using that version from svn
> > >
> > > The bold line is causing the slowness:
> > >         Console.WriteLine(string.Format(" Facetsearch for
> > > {0}",string.Join(",", fields)));
> > >  Query query = new
> > > Lucene.Net.QueryParsers.QueryParser(Lucene.Net.Util.Version.LUCENE_29,
> > > "Content-Any", new
> > >
> >
> Lucene.Net.Analysis.Standard.StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29)).Parse(value);
> > >  Console.WriteLine(string.Format("  Facetsearch for
> {0}",string.Join(",",
> > > fields)));
> > > DateTime start = DateTime.Now;
> > > * using (SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader,
> > > fields)) {*
> > > Console.WriteLine(string.Format("  Create facetsearcher
> > {0}",((DateTime.Now
> > > - start).TotalSeconds)));
> > >
> > > The facets are calculated on a searchresult set of ~32.000 items.
> > >
> > >   Facetsearch for company-owner
> > >   Create facetsearcher 0,0760043
> > >   Search facetsearcher 0,1560089
> > >   Iterate facetsearcher 0,1570089
> > > 0,2640151
> > >   Facetsearch for company-owner,country
> > >   Create facetsearcher 0,2550146
> > >   Search facetsearcher 0,6630379
> > >   Iterate facetsearcher 0,6680382
> > > 0,6690383
> > >   Facetsearch for company-owner,country,company-category
> > >   Create facetsearcher 1,1110636
> > >   Search facetsearcher 1,7340992
> > >   Iterate facetsearcher 1,7410996
> > > 1,7410996
> > >   Facetsearch for company-owner,country,company-category,language
> > >   Create facetsearcher 5,0072864
> > >   Search facetsearcher 6,0813479
> > >   Iterate facetsearcher 6,0943486
> > > 6,0963487
> > >
> > > On Fri, May 27, 2011 at 8:02 AM, digy digy <di...@gmail.com> wrote:
> > >
> > >> Indeed, I seems to be slow. With 30 facets, ~300K docs and 1.4GB index
> I
> > >> get
> > >> better results.(first query: ~100-400 ms, if I repeat it then <10ms)
> > >> Do you use the code from
> > >>
> > >>
> >
> https://svn.apache.org/repos/asf/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/SimpleFacetedSearch/
> > >>  ?
> > >>
> > >> DIGY
> > >>
> > >>
> > >> On Fri, May 27, 2011 at 12:49 AM, Marco Dissel <
> marco.dissel@gmail.com
> > >> >wrote:
> > >>
> > >> > You're are right.. It this the most optimal way of calculating
> > multiple
> > >> > facets?
> > >> >
> > >> > I get this performance result in my test:
> > >> > seconds - number of facet fields
> > >> > 0,2760158 - 1
> > >> > 0,665038 - 2
> > >> > 1,7320991 - 3
> > >> > 6,0633468 - 4
> > >> >
> > >> > on a ~300mb index
> > >> >
> > >> > Ideally i want to show an user interface with much more facets, but
> > with
> > >> > these numbers it's not possible.
> > >> >
> > >> > On Thu, May 26, 2011 at 8:10 AM, digy digy <di...@gmail.com>
> > wrote:
> > >> >
> > >> > > I still don't understand, since these numbers can easily be
> obtained
> > >> from
> > >> > > current implementation.
> > >> > > Just count HitsPerGroup.Name[i]' s.
> > >> > >
> > >> > > DIGY
> > >> > >
> > >> > > On Thu, May 26, 2011 at 12:21 AM, Marco Dissel <
> > >> marco.dissel@gmail.com
> > >> > > >wrote:
> > >> > >
> > >> > > > Let's take the sample data from http://goo.gl/UQubj
> > >> > > >
> > >> > > >          f1     f2     f3
> > >> > > >          --     --     --
> > >> > > > doc1      A      I      1
> > >> > > > doc2      A      I      2
> > >> > > > doc3      A      I      3
> > >> > > > doc4      A      J      1
> > >> > > > doc5      A      J      2
> > >> > > > doc6      A      J      3
> > >> > > > doc7      B      I      1
> > >> > > >
> > >> > > > SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader, new
> > >> > > > string[] {"f1", "f2", "f3"});
> > >> > > > SimpleFacetedSearch.Hits hits = sfs.Search(query);
> > >> > > >
> > >> > > > foreach(Facet facet in hits.Facets){ // groupByFields from
> > >> constructor
> > >> > > >
> > >> > > >   foreach(FacetTerm facetTerm in facet.FacetTerms){
> > >> > > >
> > >> > > >       WriteLine(facet.Field + facetTerm.Name +
> > facetTerm.HitCount);
> > >> > > >
> > >> > > >   }
> > >> > > >
> > >> > > > }
> > >> > > >
> > >> > > > results in:
> > >> > > > f1 - A - 6
> > >> > > > f1 - B - 1
> > >> > > > f2 - I - 4
> > >> > > > f2 - J - 3
> > >> > > > f3 - 1 - 3
> > >> > > > f3 - 2 - 1
> > >> > > > f3 - 3 - 3
> > >> > > >
> > >> > > > >> A *simple* example?
> > >> > > >
> > >> > > > I didn't say it's easy, the opposite..again thanks for your
> time.
> > >> > > >
> > >> > > > On Wed, May 25, 2011 at 10:55 PM, Digy <di...@gmail.com>
> > wrote:
> > >> > > >
> > >> > > > >
> > >> > > > > Sorry Marco,
> > >> > > > > I can't see your point. A *simple* example?
> > >> > > > >
> > >> > > > > DIGY
> > >> > > > >
> > >> > > > > -----Original Message-----
> > >> > > > > From: Marco Dissel [mailto:marco.dissel@gmail.com]
> > >> > > > > Sent: Wednesday, May 25, 2011 11:45 PM
> > >> > > > > To: lucene-net-user@lucene.apache.org
> > >> > > > > Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without
> > >> using
> > >> > > the
> > >> > > > > Bits-method
> > >> > > > >
> > >> > > > > Thank digy!
> > >> > > > >
> > >> > > > > The current sample is grouping the unique combinations of
> > multiple
> > >> > > facets
> > >> > > > > fields, but what if you want to create an facet interface like
> > on
> > >> > this
> > >> > > > > amazon.com page http://goo.gl/tBhuj ? The number of hits are
> > >> based
> > >> > on
> > >> > > a
> > >> > > > > single field query (click on "boxed set" will show 1148
> hits)..
> > >> > > > >
> > >> > > > > Edition
> > >> > > > >
> > >> > > > >   - [image: Unselected Box]Boxed Set
> > >> > > > > (1,148)<
> > >> > > > >
> > >> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fo
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> rmat_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=
> > >> > > > > 672573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > >> > > > >   - [image: Unselected Box]Full Screen
> > >> > > > > (875)<
> > >> > > > >
> > >> >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> at_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=67
> > >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > >> > > > >   - [image: Unselected Box]Widescreen
> > >> > > > > (606)<
> > >> > > > >
> > >> >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> at_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=67
> > >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > >> > > > >
> > >> > > > > Region
> > >> > > > >
> > >> > > > >   - US & CA DVDs: Region 1
> > >> > > > > (1,873)<
> > >> > > > >
> > >> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fe
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> ature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011
> > >> > > > > &bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > >> > > > >   - DVDs Playable Outside the US
> > >> > > > > (1)<
> > >> > > > >
> > >> > >
> > >>
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C67
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 2573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K7
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 9MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featur
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> e_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A129174
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 11%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn
> > >> > > > > =672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > >> > > > >   - DVDs Playable in any Region
> > >> > > > > (62)<
> > >> > > > >
> > >> > >
> > >>
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C6
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 72573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featu
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> re_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> 411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bb
> > >> > > > > n=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > >> > > > >
> > >> > > > >
> > >> > > > > Thanks
> > >> > > > >
> > >> > > > > On Wed, May 25, 2011 at 12:08 AM, Digy <di...@gmail.com>
> > >> wrote:
> > >> > > > >
> > >> > > > > > 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.wu@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 <di...@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.dissel@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 <
> > >> digydigy@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 <
> > >> > > > > > > karunakerreddyv@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 <
> > >> > > digydigy@gmail.com
> > >> > > > >
> > >> > > > > > > wrote:
> > >> > > > > > > > > >
> > >> > > > > > > > > > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > >> > > > > > > > > > >
> > >> > > > > > > > > > > DIGY
> > >> > > > > > > > > > >
> > >> > > > > > > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> > >> > > > > > larsaaslin@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
> > >> > > > > > > > > > > >
> > >> > > > > > > > > > >
> > >> > > > > > > > > >
> > >> > > > > > > > >
> > >> > > > > > > >
> > >> > > > > > >
> > >> > > > > >
> > >> > > > > >
> > >> > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> > >
> > >
> >
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by digy digy <di...@gmail.com>.
Suppose every field contains 20 unique terms, then you have 64,000,000
combinations to compute in constructor.
(I think, SFS finds only 949 of them usable(BitSets with >0 cardinality)).

DIGY

On Fri, May 27, 2011 at 12:14 PM, Marco Dissel <ma...@gmail.com>wrote:

> If I increase my number of facetfields to 6, the time to create a
> SimpleFacetedSearch instance is over ~ 10 minutes... (compiled in release
> and outside VisualStudio).. the number of HitsGroup is 949..
>
>
> On Fri, May 27, 2011 at 8:46 AM, Marco Dissel <marco.dissel@gmail.com
> >wrote:
>
> > That's strange.. i'm using that version from svn
> >
> > The bold line is causing the slowness:
> >         Console.WriteLine(string.Format(" Facetsearch for
> > {0}",string.Join(",", fields)));
> >  Query query = new
> > Lucene.Net.QueryParsers.QueryParser(Lucene.Net.Util.Version.LUCENE_29,
> > "Content-Any", new
> >
> Lucene.Net.Analysis.Standard.StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29)).Parse(value);
> >  Console.WriteLine(string.Format("  Facetsearch for {0}",string.Join(",",
> > fields)));
> > DateTime start = DateTime.Now;
> > * using (SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader,
> > fields)) {*
> > Console.WriteLine(string.Format("  Create facetsearcher
> {0}",((DateTime.Now
> > - start).TotalSeconds)));
> >
> > The facets are calculated on a searchresult set of ~32.000 items.
> >
> >   Facetsearch for company-owner
> >   Create facetsearcher 0,0760043
> >   Search facetsearcher 0,1560089
> >   Iterate facetsearcher 0,1570089
> > 0,2640151
> >   Facetsearch for company-owner,country
> >   Create facetsearcher 0,2550146
> >   Search facetsearcher 0,6630379
> >   Iterate facetsearcher 0,6680382
> > 0,6690383
> >   Facetsearch for company-owner,country,company-category
> >   Create facetsearcher 1,1110636
> >   Search facetsearcher 1,7340992
> >   Iterate facetsearcher 1,7410996
> > 1,7410996
> >   Facetsearch for company-owner,country,company-category,language
> >   Create facetsearcher 5,0072864
> >   Search facetsearcher 6,0813479
> >   Iterate facetsearcher 6,0943486
> > 6,0963487
> >
> > On Fri, May 27, 2011 at 8:02 AM, digy digy <di...@gmail.com> wrote:
> >
> >> Indeed, I seems to be slow. With 30 facets, ~300K docs and 1.4GB index I
> >> get
> >> better results.(first query: ~100-400 ms, if I repeat it then <10ms)
> >> Do you use the code from
> >>
> >>
> https://svn.apache.org/repos/asf/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/SimpleFacetedSearch/
> >>  ?
> >>
> >> DIGY
> >>
> >>
> >> On Fri, May 27, 2011 at 12:49 AM, Marco Dissel <marco.dissel@gmail.com
> >> >wrote:
> >>
> >> > You're are right.. It this the most optimal way of calculating
> multiple
> >> > facets?
> >> >
> >> > I get this performance result in my test:
> >> > seconds - number of facet fields
> >> > 0,2760158 - 1
> >> > 0,665038 - 2
> >> > 1,7320991 - 3
> >> > 6,0633468 - 4
> >> >
> >> > on a ~300mb index
> >> >
> >> > Ideally i want to show an user interface with much more facets, but
> with
> >> > these numbers it's not possible.
> >> >
> >> > On Thu, May 26, 2011 at 8:10 AM, digy digy <di...@gmail.com>
> wrote:
> >> >
> >> > > I still don't understand, since these numbers can easily be obtained
> >> from
> >> > > current implementation.
> >> > > Just count HitsPerGroup.Name[i]' s.
> >> > >
> >> > > DIGY
> >> > >
> >> > > On Thu, May 26, 2011 at 12:21 AM, Marco Dissel <
> >> marco.dissel@gmail.com
> >> > > >wrote:
> >> > >
> >> > > > Let's take the sample data from http://goo.gl/UQubj
> >> > > >
> >> > > >          f1     f2     f3
> >> > > >          --     --     --
> >> > > > doc1      A      I      1
> >> > > > doc2      A      I      2
> >> > > > doc3      A      I      3
> >> > > > doc4      A      J      1
> >> > > > doc5      A      J      2
> >> > > > doc6      A      J      3
> >> > > > doc7      B      I      1
> >> > > >
> >> > > > SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader, new
> >> > > > string[] {"f1", "f2", "f3"});
> >> > > > SimpleFacetedSearch.Hits hits = sfs.Search(query);
> >> > > >
> >> > > > foreach(Facet facet in hits.Facets){ // groupByFields from
> >> constructor
> >> > > >
> >> > > >   foreach(FacetTerm facetTerm in facet.FacetTerms){
> >> > > >
> >> > > >       WriteLine(facet.Field + facetTerm.Name +
> facetTerm.HitCount);
> >> > > >
> >> > > >   }
> >> > > >
> >> > > > }
> >> > > >
> >> > > > results in:
> >> > > > f1 - A - 6
> >> > > > f1 - B - 1
> >> > > > f2 - I - 4
> >> > > > f2 - J - 3
> >> > > > f3 - 1 - 3
> >> > > > f3 - 2 - 1
> >> > > > f3 - 3 - 3
> >> > > >
> >> > > > >> A *simple* example?
> >> > > >
> >> > > > I didn't say it's easy, the opposite..again thanks for your time.
> >> > > >
> >> > > > On Wed, May 25, 2011 at 10:55 PM, Digy <di...@gmail.com>
> wrote:
> >> > > >
> >> > > > >
> >> > > > > Sorry Marco,
> >> > > > > I can't see your point. A *simple* example?
> >> > > > >
> >> > > > > DIGY
> >> > > > >
> >> > > > > -----Original Message-----
> >> > > > > From: Marco Dissel [mailto:marco.dissel@gmail.com]
> >> > > > > Sent: Wednesday, May 25, 2011 11:45 PM
> >> > > > > To: lucene-net-user@lucene.apache.org
> >> > > > > Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without
> >> using
> >> > > the
> >> > > > > Bits-method
> >> > > > >
> >> > > > > Thank digy!
> >> > > > >
> >> > > > > The current sample is grouping the unique combinations of
> multiple
> >> > > facets
> >> > > > > fields, but what if you want to create an facet interface like
> on
> >> > this
> >> > > > > amazon.com page http://goo.gl/tBhuj ? The number of hits are
> >> based
> >> > on
> >> > > a
> >> > > > > single field query (click on "boxed set" will show 1148 hits)..
> >> > > > >
> >> > > > > Edition
> >> > > > >
> >> > > > >   - [image: Unselected Box]Boxed Set
> >> > > > > (1,148)<
> >> > > > >
> >> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fo
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> rmat_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=
> >> > > > > 672573011&ie=UTF8&qid=1306356036&rnid=390118011>
> >> > > > >   - [image: Unselected Box]Full Screen
> >> > > > > (875)<
> >> > > > >
> >> >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> at_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=67
> >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> >> > > > >   - [image: Unselected Box]Widescreen
> >> > > > > (606)<
> >> > > > >
> >> >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> at_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=67
> >> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> >> > > > >
> >> > > > > Region
> >> > > > >
> >> > > > >   - US & CA DVDs: Region 1
> >> > > > > (1,873)<
> >> > > > >
> >> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fe
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> ature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011
> >> > > > > &bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> >> > > > >   - DVDs Playable Outside the US
> >> > > > > (1)<
> >> > > > >
> >> > >
> >>
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C67
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 2573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K7
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 9MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featur
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> e_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A129174
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 11%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn
> >> > > > > =672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> >> > > > >   - DVDs Playable in any Region
> >> > > > > (62)<
> >> > > > >
> >> > >
> >> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C6
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 72573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featu
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> re_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> 411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bb
> >> > > > > n=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> >> > > > >
> >> > > > >
> >> > > > > Thanks
> >> > > > >
> >> > > > > On Wed, May 25, 2011 at 12:08 AM, Digy <di...@gmail.com>
> >> wrote:
> >> > > > >
> >> > > > > > 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.wu@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 <di...@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.dissel@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 <
> >> digydigy@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 <
> >> > > > > > > karunakerreddyv@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 <
> >> > > digydigy@gmail.com
> >> > > > >
> >> > > > > > > wrote:
> >> > > > > > > > > >
> >> > > > > > > > > > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> >> > > > > > > > > > >
> >> > > > > > > > > > > DIGY
> >> > > > > > > > > > >
> >> > > > > > > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> >> > > > > > larsaaslin@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
> >> > > > > > > > > > > >
> >> > > > > > > > > > >
> >> > > > > > > > > >
> >> > > > > > > > >
> >> > > > > > > >
> >> > > > > > >
> >> > > > > >
> >> > > > > >
> >> > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> >
> >
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Marco Dissel <ma...@gmail.com>.
If I increase my number of facetfields to 6, the time to create a
SimpleFacetedSearch instance is over ~ 10 minutes... (compiled in release
and outside VisualStudio).. the number of HitsGroup is 949..


On Fri, May 27, 2011 at 8:46 AM, Marco Dissel <ma...@gmail.com>wrote:

> That's strange.. i'm using that version from svn
>
> The bold line is causing the slowness:
>         Console.WriteLine(string.Format(" Facetsearch for
> {0}",string.Join(",", fields)));
>  Query query = new
> Lucene.Net.QueryParsers.QueryParser(Lucene.Net.Util.Version.LUCENE_29,
> "Content-Any", new
> Lucene.Net.Analysis.Standard.StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29)).Parse(value);
>  Console.WriteLine(string.Format("  Facetsearch for {0}",string.Join(",",
> fields)));
> DateTime start = DateTime.Now;
> * using (SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader,
> fields)) {*
> Console.WriteLine(string.Format("  Create facetsearcher {0}",((DateTime.Now
> - start).TotalSeconds)));
>
> The facets are calculated on a searchresult set of ~32.000 items.
>
>   Facetsearch for company-owner
>   Create facetsearcher 0,0760043
>   Search facetsearcher 0,1560089
>   Iterate facetsearcher 0,1570089
> 0,2640151
>   Facetsearch for company-owner,country
>   Create facetsearcher 0,2550146
>   Search facetsearcher 0,6630379
>   Iterate facetsearcher 0,6680382
> 0,6690383
>   Facetsearch for company-owner,country,company-category
>   Create facetsearcher 1,1110636
>   Search facetsearcher 1,7340992
>   Iterate facetsearcher 1,7410996
> 1,7410996
>   Facetsearch for company-owner,country,company-category,language
>   Create facetsearcher 5,0072864
>   Search facetsearcher 6,0813479
>   Iterate facetsearcher 6,0943486
> 6,0963487
>
> On Fri, May 27, 2011 at 8:02 AM, digy digy <di...@gmail.com> wrote:
>
>> Indeed, I seems to be slow. With 30 facets, ~300K docs and 1.4GB index I
>> get
>> better results.(first query: ~100-400 ms, if I repeat it then <10ms)
>> Do you use the code from
>>
>> https://svn.apache.org/repos/asf/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/SimpleFacetedSearch/
>>  ?
>>
>> DIGY
>>
>>
>> On Fri, May 27, 2011 at 12:49 AM, Marco Dissel <marco.dissel@gmail.com
>> >wrote:
>>
>> > You're are right.. It this the most optimal way of calculating multiple
>> > facets?
>> >
>> > I get this performance result in my test:
>> > seconds - number of facet fields
>> > 0,2760158 - 1
>> > 0,665038 - 2
>> > 1,7320991 - 3
>> > 6,0633468 - 4
>> >
>> > on a ~300mb index
>> >
>> > Ideally i want to show an user interface with much more facets, but with
>> > these numbers it's not possible.
>> >
>> > On Thu, May 26, 2011 at 8:10 AM, digy digy <di...@gmail.com> wrote:
>> >
>> > > I still don't understand, since these numbers can easily be obtained
>> from
>> > > current implementation.
>> > > Just count HitsPerGroup.Name[i]' s.
>> > >
>> > > DIGY
>> > >
>> > > On Thu, May 26, 2011 at 12:21 AM, Marco Dissel <
>> marco.dissel@gmail.com
>> > > >wrote:
>> > >
>> > > > Let's take the sample data from http://goo.gl/UQubj
>> > > >
>> > > >          f1     f2     f3
>> > > >          --     --     --
>> > > > doc1      A      I      1
>> > > > doc2      A      I      2
>> > > > doc3      A      I      3
>> > > > doc4      A      J      1
>> > > > doc5      A      J      2
>> > > > doc6      A      J      3
>> > > > doc7      B      I      1
>> > > >
>> > > > SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader, new
>> > > > string[] {"f1", "f2", "f3"});
>> > > > SimpleFacetedSearch.Hits hits = sfs.Search(query);
>> > > >
>> > > > foreach(Facet facet in hits.Facets){ // groupByFields from
>> constructor
>> > > >
>> > > >   foreach(FacetTerm facetTerm in facet.FacetTerms){
>> > > >
>> > > >       WriteLine(facet.Field + facetTerm.Name + facetTerm.HitCount);
>> > > >
>> > > >   }
>> > > >
>> > > > }
>> > > >
>> > > > results in:
>> > > > f1 - A - 6
>> > > > f1 - B - 1
>> > > > f2 - I - 4
>> > > > f2 - J - 3
>> > > > f3 - 1 - 3
>> > > > f3 - 2 - 1
>> > > > f3 - 3 - 3
>> > > >
>> > > > >> A *simple* example?
>> > > >
>> > > > I didn't say it's easy, the opposite..again thanks for your time.
>> > > >
>> > > > On Wed, May 25, 2011 at 10:55 PM, Digy <di...@gmail.com> wrote:
>> > > >
>> > > > >
>> > > > > Sorry Marco,
>> > > > > I can't see your point. A *simple* example?
>> > > > >
>> > > > > DIGY
>> > > > >
>> > > > > -----Original Message-----
>> > > > > From: Marco Dissel [mailto:marco.dissel@gmail.com]
>> > > > > Sent: Wednesday, May 25, 2011 11:45 PM
>> > > > > To: lucene-net-user@lucene.apache.org
>> > > > > Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without
>> using
>> > > the
>> > > > > Bits-method
>> > > > >
>> > > > > Thank digy!
>> > > > >
>> > > > > The current sample is grouping the unique combinations of multiple
>> > > facets
>> > > > > fields, but what if you want to create an facet interface like on
>> > this
>> > > > > amazon.com page http://goo.gl/tBhuj ? The number of hits are
>> based
>> > on
>> > > a
>> > > > > single field query (click on "boxed set" will show 1148 hits)..
>> > > > >
>> > > > > Edition
>> > > > >
>> > > > >   - [image: Unselected Box]Boxed Set
>> > > > > (1,148)<
>> > > > >
>> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fo
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> rmat_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=
>> > > > > 672573011&ie=UTF8&qid=1306356036&rnid=390118011>
>> > > > >   - [image: Unselected Box]Full Screen
>> > > > > (875)<
>> > > > >
>> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> at_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=67
>> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
>> > > > >   - [image: Unselected Box]Widescreen
>> > > > > (606)<
>> > > > >
>> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> at_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=67
>> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
>> > > > >
>> > > > > Region
>> > > > >
>> > > > >   - US & CA DVDs: Region 1
>> > > > > (1,873)<
>> > > > >
>> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fe
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> ature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011
>> > > > > &bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
>> > > > >   - DVDs Playable Outside the US
>> > > > > (1)<
>> > > > >
>> > >
>> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C67
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 2573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K7
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 9MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featur
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> e_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A129174
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 11%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn
>> > > > > =672573011&ie=UTF8&qid=1306356036&rnid=405390011>
>> > > > >   - DVDs Playable in any Region
>> > > > > (62)<
>> > > > >
>> > >
>> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C6
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 72573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featu
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> re_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bb
>> > > > > n=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
>> > > > >
>> > > > >
>> > > > > Thanks
>> > > > >
>> > > > > On Wed, May 25, 2011 at 12:08 AM, Digy <di...@gmail.com>
>> wrote:
>> > > > >
>> > > > > > 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.wu@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 <di...@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.dissel@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 <
>> digydigy@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 <
>> > > > > > > karunakerreddyv@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 <
>> > > digydigy@gmail.com
>> > > > >
>> > > > > > > wrote:
>> > > > > > > > > >
>> > > > > > > > > > > Take a look at OpenBitSetDISI in Lucene.Net.Util
>> > > > > > > > > > >
>> > > > > > > > > > > DIGY
>> > > > > > > > > > >
>> > > > > > > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
>> > > > > > larsaaslin@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
>> > > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > > >
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>>
>
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Marco Dissel <ma...@gmail.com>.
That's strange.. i'm using that version from svn

The bold line is causing the slowness:
        Console.WriteLine(string.Format(" Facetsearch for
{0}",string.Join(",", fields)));
Query query = new
Lucene.Net.QueryParsers.QueryParser(Lucene.Net.Util.Version.LUCENE_29,
"Content-Any", new
Lucene.Net.Analysis.Standard.StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29)).Parse(value);
Console.WriteLine(string.Format("  Facetsearch for {0}",string.Join(",",
fields)));
DateTime start = DateTime.Now;
* using (SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader, fields))
{*
Console.WriteLine(string.Format("  Create facetsearcher {0}",((DateTime.Now
- start).TotalSeconds)));

The facets are calculated on a searchresult set of ~32.000 items.

  Facetsearch for company-owner
  Create facetsearcher 0,0760043
  Search facetsearcher 0,1560089
  Iterate facetsearcher 0,1570089
0,2640151
  Facetsearch for company-owner,country
  Create facetsearcher 0,2550146
  Search facetsearcher 0,6630379
  Iterate facetsearcher 0,6680382
0,6690383
  Facetsearch for company-owner,country,company-category
  Create facetsearcher 1,1110636
  Search facetsearcher 1,7340992
  Iterate facetsearcher 1,7410996
1,7410996
  Facetsearch for company-owner,country,company-category,language
  Create facetsearcher 5,0072864
  Search facetsearcher 6,0813479
  Iterate facetsearcher 6,0943486
6,0963487

On Fri, May 27, 2011 at 8:02 AM, digy digy <di...@gmail.com> wrote:

> Indeed, I seems to be slow. With 30 facets, ~300K docs and 1.4GB index I
> get
> better results.(first query: ~100-400 ms, if I repeat it then <10ms)
> Do you use the code from
>
> https://svn.apache.org/repos/asf/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/SimpleFacetedSearch/
>  ?
>
> DIGY
>
>
> On Fri, May 27, 2011 at 12:49 AM, Marco Dissel <marco.dissel@gmail.com
> >wrote:
>
> > You're are right.. It this the most optimal way of calculating multiple
> > facets?
> >
> > I get this performance result in my test:
> > seconds - number of facet fields
> > 0,2760158 - 1
> > 0,665038 - 2
> > 1,7320991 - 3
> > 6,0633468 - 4
> >
> > on a ~300mb index
> >
> > Ideally i want to show an user interface with much more facets, but with
> > these numbers it's not possible.
> >
> > On Thu, May 26, 2011 at 8:10 AM, digy digy <di...@gmail.com> wrote:
> >
> > > I still don't understand, since these numbers can easily be obtained
> from
> > > current implementation.
> > > Just count HitsPerGroup.Name[i]' s.
> > >
> > > DIGY
> > >
> > > On Thu, May 26, 2011 at 12:21 AM, Marco Dissel <marco.dissel@gmail.com
> > > >wrote:
> > >
> > > > Let's take the sample data from http://goo.gl/UQubj
> > > >
> > > >          f1     f2     f3
> > > >          --     --     --
> > > > doc1      A      I      1
> > > > doc2      A      I      2
> > > > doc3      A      I      3
> > > > doc4      A      J      1
> > > > doc5      A      J      2
> > > > doc6      A      J      3
> > > > doc7      B      I      1
> > > >
> > > > SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader, new
> > > > string[] {"f1", "f2", "f3"});
> > > > SimpleFacetedSearch.Hits hits = sfs.Search(query);
> > > >
> > > > foreach(Facet facet in hits.Facets){ // groupByFields from
> constructor
> > > >
> > > >   foreach(FacetTerm facetTerm in facet.FacetTerms){
> > > >
> > > >       WriteLine(facet.Field + facetTerm.Name + facetTerm.HitCount);
> > > >
> > > >   }
> > > >
> > > > }
> > > >
> > > > results in:
> > > > f1 - A - 6
> > > > f1 - B - 1
> > > > f2 - I - 4
> > > > f2 - J - 3
> > > > f3 - 1 - 3
> > > > f3 - 2 - 1
> > > > f3 - 3 - 3
> > > >
> > > > >> A *simple* example?
> > > >
> > > > I didn't say it's easy, the opposite..again thanks for your time.
> > > >
> > > > On Wed, May 25, 2011 at 10:55 PM, Digy <di...@gmail.com> wrote:
> > > >
> > > > >
> > > > > Sorry Marco,
> > > > > I can't see your point. A *simple* example?
> > > > >
> > > > > DIGY
> > > > >
> > > > > -----Original Message-----
> > > > > From: Marco Dissel [mailto:marco.dissel@gmail.com]
> > > > > Sent: Wednesday, May 25, 2011 11:45 PM
> > > > > To: lucene-net-user@lucene.apache.org
> > > > > Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without
> using
> > > the
> > > > > Bits-method
> > > > >
> > > > > Thank digy!
> > > > >
> > > > > The current sample is grouping the unique combinations of multiple
> > > facets
> > > > > fields, but what if you want to create an facet interface like on
> > this
> > > > > amazon.com page http://goo.gl/tBhuj ? The number of hits are based
> > on
> > > a
> > > > > single field query (click on "boxed set" will show 1148 hits)..
> > > > >
> > > > > Edition
> > > > >
> > > > >   - [image: Unselected Box]Boxed Set
> > > > > (1,148)<
> > > > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > > >
> > > > >
> > > >
> > >
> >
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > > >
> > > > >
> > > >
> > >
> >
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fo
> > > > >
> > > > >
> > > >
> > >
> >
> rmat_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > > >
> > > > >
> > > >
> > >
> >
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=
> > > > > 672573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > >   - [image: Unselected Box]Full Screen
> > > > > (875)<
> > > > >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > > >
> > > > >
> > > >
> > >
> >
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > > >
> > > > >
> > > >
> > >
> >
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > > >
> > > > >
> > > >
> > >
> >
> at_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > > >
> > > > >
> > > >
> > >
> >
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=67
> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > >   - [image: Unselected Box]Widescreen
> > > > > (606)<
> > > > >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > > >
> > > > >
> > > >
> > >
> >
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > > >
> > > > >
> > > >
> > >
> >
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > > >
> > > > >
> > > >
> > >
> >
> at_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > > >
> > > > >
> > > >
> > >
> >
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=67
> > > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > > >
> > > > > Region
> > > > >
> > > > >   - US & CA DVDs: Region 1
> > > > > (1,873)<
> > > > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > > >
> > > > >
> > > >
> > >
> >
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > > >
> > > > >
> > > >
> > >
> >
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fe
> > > > >
> > > > >
> > > >
> > >
> >
> ature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > > >
> > > > >
> > > >
> > >
> >
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011
> > > > > &bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > >   - DVDs Playable Outside the US
> > > > > (1)<
> > > > >
> > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C67
> > > > >
> > > > >
> > > >
> > >
> >
> 2573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K7
> > > > >
> > > > >
> > > >
> > >
> >
> 9MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featur
> > > > >
> > > > >
> > > >
> > >
> >
> e_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A129174
> > > > >
> > > > >
> > > >
> > >
> >
> 11%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn
> > > > > =672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > >   - DVDs Playable in any Region
> > > > > (62)<
> > > > >
> > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C6
> > > > >
> > > > >
> > > >
> > >
> >
> 72573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K
> > > > >
> > > > >
> > > >
> > >
> >
> 79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featu
> > > > >
> > > > >
> > > >
> > >
> >
> re_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917
> > > > >
> > > > >
> > > >
> > >
> >
> 411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bb
> > > > > n=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > > >
> > > > >
> > > > > Thanks
> > > > >
> > > > > On Wed, May 25, 2011 at 12:08 AM, Digy <di...@gmail.com> wrote:
> > > > >
> > > > > > 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.wu@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 <di...@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.dissel@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 <
> digydigy@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 <
> > > > > > > karunakerreddyv@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 <
> > > digydigy@gmail.com
> > > > >
> > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > > > > > > > > > >
> > > > > > > > > > > DIGY
> > > > > > > > > > >
> > > > > > > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> > > > > > larsaaslin@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
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by digy digy <di...@gmail.com>.
Indeed, I seems to be slow. With 30 facets, ~300K docs and 1.4GB index I get
better results.(first query: ~100-400 ms, if I repeat it then <10ms)
Do you use the code from
https://svn.apache.org/repos/asf/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/SimpleFacetedSearch/
 ?

DIGY


On Fri, May 27, 2011 at 12:49 AM, Marco Dissel <ma...@gmail.com>wrote:

> You're are right.. It this the most optimal way of calculating multiple
> facets?
>
> I get this performance result in my test:
> seconds - number of facet fields
> 0,2760158 - 1
> 0,665038 - 2
> 1,7320991 - 3
> 6,0633468 - 4
>
> on a ~300mb index
>
> Ideally i want to show an user interface with much more facets, but with
> these numbers it's not possible.
>
> On Thu, May 26, 2011 at 8:10 AM, digy digy <di...@gmail.com> wrote:
>
> > I still don't understand, since these numbers can easily be obtained from
> > current implementation.
> > Just count HitsPerGroup.Name[i]' s.
> >
> > DIGY
> >
> > On Thu, May 26, 2011 at 12:21 AM, Marco Dissel <marco.dissel@gmail.com
> > >wrote:
> >
> > > Let's take the sample data from http://goo.gl/UQubj
> > >
> > >          f1     f2     f3
> > >          --     --     --
> > > doc1      A      I      1
> > > doc2      A      I      2
> > > doc3      A      I      3
> > > doc4      A      J      1
> > > doc5      A      J      2
> > > doc6      A      J      3
> > > doc7      B      I      1
> > >
> > > SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader, new
> > > string[] {"f1", "f2", "f3"});
> > > SimpleFacetedSearch.Hits hits = sfs.Search(query);
> > >
> > > foreach(Facet facet in hits.Facets){ // groupByFields from constructor
> > >
> > >   foreach(FacetTerm facetTerm in facet.FacetTerms){
> > >
> > >       WriteLine(facet.Field + facetTerm.Name + facetTerm.HitCount);
> > >
> > >   }
> > >
> > > }
> > >
> > > results in:
> > > f1 - A - 6
> > > f1 - B - 1
> > > f2 - I - 4
> > > f2 - J - 3
> > > f3 - 1 - 3
> > > f3 - 2 - 1
> > > f3 - 3 - 3
> > >
> > > >> A *simple* example?
> > >
> > > I didn't say it's easy, the opposite..again thanks for your time.
> > >
> > > On Wed, May 25, 2011 at 10:55 PM, Digy <di...@gmail.com> wrote:
> > >
> > > >
> > > > Sorry Marco,
> > > > I can't see your point. A *simple* example?
> > > >
> > > > DIGY
> > > >
> > > > -----Original Message-----
> > > > From: Marco Dissel [mailto:marco.dissel@gmail.com]
> > > > Sent: Wednesday, May 25, 2011 11:45 PM
> > > > To: lucene-net-user@lucene.apache.org
> > > > Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without using
> > the
> > > > Bits-method
> > > >
> > > > Thank digy!
> > > >
> > > > The current sample is grouping the unique combinations of multiple
> > facets
> > > > fields, but what if you want to create an facet interface like on
> this
> > > > amazon.com page http://goo.gl/tBhuj ? The number of hits are based
> on
> > a
> > > > single field query (click on "boxed set" will show 1148 hits)..
> > > >
> > > > Edition
> > > >
> > > >   - [image: Unselected Box]Boxed Set
> > > > (1,148)<
> > > > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > >
> > > >
> > >
> >
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > >
> > > >
> > >
> >
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fo
> > > >
> > > >
> > >
> >
> rmat_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > >
> > > >
> > >
> >
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=
> > > > 672573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > >   - [image: Unselected Box]Full Screen
> > > > (875)<
> > > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > >
> > > >
> > >
> >
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > >
> > > >
> > >
> >
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > >
> > > >
> > >
> >
> at_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > >
> > > >
> > >
> >
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=67
> > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > >   - [image: Unselected Box]Widescreen
> > > > (606)<
> > > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > > >
> > > >
> > >
> >
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > > >
> > > >
> > >
> >
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > > >
> > > >
> > >
> >
> at_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > > >
> > > >
> > >
> >
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=67
> > > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > > >
> > > > Region
> > > >
> > > >   - US & CA DVDs: Region 1
> > > > (1,873)<
> > > > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > > >
> > > >
> > >
> >
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > > >
> > > >
> > >
> >
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fe
> > > >
> > > >
> > >
> >
> ature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > > >
> > > >
> > >
> >
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011
> > > > &bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > >   - DVDs Playable Outside the US
> > > > (1)<
> > > >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C67
> > > >
> > > >
> > >
> >
> 2573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K7
> > > >
> > > >
> > >
> >
> 9MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featur
> > > >
> > > >
> > >
> >
> e_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A129174
> > > >
> > > >
> > >
> >
> 11%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn
> > > > =672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > >   - DVDs Playable in any Region
> > > > (62)<
> > > >
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C6
> > > >
> > > >
> > >
> >
> 72573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K
> > > >
> > > >
> > >
> >
> 79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featu
> > > >
> > > >
> > >
> >
> re_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917
> > > >
> > > >
> > >
> >
> 411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bb
> > > > n=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > > >
> > > >
> > > > Thanks
> > > >
> > > > On Wed, May 25, 2011 at 12:08 AM, Digy <di...@gmail.com> wrote:
> > > >
> > > > > 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.wu@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 <di...@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.dissel@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 <digydigy@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 <
> > > > > > karunakerreddyv@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 <
> > digydigy@gmail.com
> > > >
> > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > > > > > > > > >
> > > > > > > > > > DIGY
> > > > > > > > > >
> > > > > > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> > > > > larsaaslin@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
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> >
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Marco Dissel <ma...@gmail.com>.
You're are right.. It this the most optimal way of calculating multiple
facets?

I get this performance result in my test:
seconds - number of facet fields
0,2760158 - 1
0,665038 - 2
1,7320991 - 3
6,0633468 - 4

on a ~300mb index

Ideally i want to show an user interface with much more facets, but with
these numbers it's not possible.

On Thu, May 26, 2011 at 8:10 AM, digy digy <di...@gmail.com> wrote:

> I still don't understand, since these numbers can easily be obtained from
> current implementation.
> Just count HitsPerGroup.Name[i]' s.
>
> DIGY
>
> On Thu, May 26, 2011 at 12:21 AM, Marco Dissel <marco.dissel@gmail.com
> >wrote:
>
> > Let's take the sample data from http://goo.gl/UQubj
> >
> >          f1     f2     f3
> >          --     --     --
> > doc1      A      I      1
> > doc2      A      I      2
> > doc3      A      I      3
> > doc4      A      J      1
> > doc5      A      J      2
> > doc6      A      J      3
> > doc7      B      I      1
> >
> > SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader, new
> > string[] {"f1", "f2", "f3"});
> > SimpleFacetedSearch.Hits hits = sfs.Search(query);
> >
> > foreach(Facet facet in hits.Facets){ // groupByFields from constructor
> >
> >   foreach(FacetTerm facetTerm in facet.FacetTerms){
> >
> >       WriteLine(facet.Field + facetTerm.Name + facetTerm.HitCount);
> >
> >   }
> >
> > }
> >
> > results in:
> > f1 - A - 6
> > f1 - B - 1
> > f2 - I - 4
> > f2 - J - 3
> > f3 - 1 - 3
> > f3 - 2 - 1
> > f3 - 3 - 3
> >
> > >> A *simple* example?
> >
> > I didn't say it's easy, the opposite..again thanks for your time.
> >
> > On Wed, May 25, 2011 at 10:55 PM, Digy <di...@gmail.com> wrote:
> >
> > >
> > > Sorry Marco,
> > > I can't see your point. A *simple* example?
> > >
> > > DIGY
> > >
> > > -----Original Message-----
> > > From: Marco Dissel [mailto:marco.dissel@gmail.com]
> > > Sent: Wednesday, May 25, 2011 11:45 PM
> > > To: lucene-net-user@lucene.apache.org
> > > Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without using
> the
> > > Bits-method
> > >
> > > Thank digy!
> > >
> > > The current sample is grouping the unique combinations of multiple
> facets
> > > fields, but what if you want to create an facet interface like on this
> > > amazon.com page http://goo.gl/tBhuj ? The number of hits are based on
> a
> > > single field query (click on "boxed set" will show 1148 hits)..
> > >
> > > Edition
> > >
> > >   - [image: Unselected Box]Boxed Set
> > > (1,148)<
> > > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > >
> > >
> >
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > >
> > >
> >
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fo
> > >
> > >
> >
> rmat_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > >
> > >
> >
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=
> > > 672573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > >   - [image: Unselected Box]Full Screen
> > > (875)<
> > > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > >
> > >
> >
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > >
> > >
> >
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > >
> > >
> >
> at_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > >
> > >
> >
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=67
> > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > >   - [image: Unselected Box]Widescreen
> > > (606)<
> > > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> > >
> > >
> >
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> > >
> > >
> >
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> > >
> > >
> >
> at_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> > >
> > >
> >
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=67
> > > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> > >
> > > Region
> > >
> > >   - US & CA DVDs: Region 1
> > > (1,873)<
> > > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> > >
> > >
> >
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> > >
> > >
> >
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fe
> > >
> > >
> >
> ature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> > >
> > >
> >
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011
> > > &bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > >   - DVDs Playable Outside the US
> > > (1)<
> > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C67
> > >
> > >
> >
> 2573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K7
> > >
> > >
> >
> 9MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featur
> > >
> > >
> >
> e_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A129174
> > >
> > >
> >
> 11%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn
> > > =672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > >   - DVDs Playable in any Region
> > > (62)<
> > >
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C6
> > >
> > >
> >
> 72573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K
> > >
> > >
> >
> 79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featu
> > >
> > >
> >
> re_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917
> > >
> > >
> >
> 411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bb
> > > n=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> > >
> > >
> > > Thanks
> > >
> > > On Wed, May 25, 2011 at 12:08 AM, Digy <di...@gmail.com> wrote:
> > >
> > > > 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.wu@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 <di...@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.dissel@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 <di...@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 <
> > > > > karunakerreddyv@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 <
> digydigy@gmail.com
> > >
> > > > > wrote:
> > > > > > > >
> > > > > > > > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > > > > > > > >
> > > > > > > > > DIGY
> > > > > > > > >
> > > > > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> > > > larsaaslin@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
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by digy digy <di...@gmail.com>.
I still don't understand, since these numbers can easily be obtained from
current implementation.
Just count HitsPerGroup.Name[i]' s.

DIGY

On Thu, May 26, 2011 at 12:21 AM, Marco Dissel <ma...@gmail.com>wrote:

> Let's take the sample data from http://goo.gl/UQubj
>
>          f1     f2     f3
>          --     --     --
> doc1      A      I      1
> doc2      A      I      2
> doc3      A      I      3
> doc4      A      J      1
> doc5      A      J      2
> doc6      A      J      3
> doc7      B      I      1
>
> SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader, new
> string[] {"f1", "f2", "f3"});
> SimpleFacetedSearch.Hits hits = sfs.Search(query);
>
> foreach(Facet facet in hits.Facets){ // groupByFields from constructor
>
>   foreach(FacetTerm facetTerm in facet.FacetTerms){
>
>       WriteLine(facet.Field + facetTerm.Name + facetTerm.HitCount);
>
>   }
>
> }
>
> results in:
> f1 - A - 6
> f1 - B - 1
> f2 - I - 4
> f2 - J - 3
> f3 - 1 - 3
> f3 - 2 - 1
> f3 - 3 - 3
>
> >> A *simple* example?
>
> I didn't say it's easy, the opposite..again thanks for your time.
>
> On Wed, May 25, 2011 at 10:55 PM, Digy <di...@gmail.com> wrote:
>
> >
> > Sorry Marco,
> > I can't see your point. A *simple* example?
> >
> > DIGY
> >
> > -----Original Message-----
> > From: Marco Dissel [mailto:marco.dissel@gmail.com]
> > Sent: Wednesday, May 25, 2011 11:45 PM
> > To: lucene-net-user@lucene.apache.org
> > Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without using the
> > Bits-method
> >
> > Thank digy!
> >
> > The current sample is grouping the unique combinations of multiple facets
> > fields, but what if you want to create an facet interface like on this
> > amazon.com page http://goo.gl/tBhuj ? The number of hits are based on a
> > single field query (click on "boxed set" will show 1148 hits)..
> >
> > Edition
> >
> >   - [image: Unselected Box]Boxed Set
> > (1,148)<
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> >
> >
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> >
> >
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fo
> >
> >
> rmat_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> >
> >
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=
> > 672573011&ie=UTF8&qid=1306356036&rnid=390118011>
> >   - [image: Unselected Box]Full Screen
> > (875)<
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> >
> >
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> >
> >
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> >
> >
> at_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> >
> >
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=67
> > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> >   - [image: Unselected Box]Widescreen
> > (606)<
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
> >
> >
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
> >
> >
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
> >
> >
> at_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
> >
> >
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=67
> > 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
> >
> > Region
> >
> >   - US & CA DVDs: Region 1
> > (1,873)<
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
> >
> >
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
> >
> >
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fe
> >
> >
> ature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
> >
> >
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011
> > &bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> >   - DVDs Playable Outside the US
> > (1)<
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C67
> >
> >
> 2573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K7
> >
> >
> 9MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featur
> >
> >
> e_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A129174
> >
> >
> 11%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn
> > =672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> >   - DVDs Playable in any Region
> > (62)<
> > http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C6
> >
> >
> 72573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K
> >
> >
> 79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featu
> >
> >
> re_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917
> >
> >
> 411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bb
> > n=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
> >
> >
> > Thanks
> >
> > On Wed, May 25, 2011 at 12:08 AM, Digy <di...@gmail.com> wrote:
> >
> > > 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.wu@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 <di...@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.dissel@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 <di...@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 <
> > > > karunakerreddyv@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 <digydigy@gmail.com
> >
> > > > wrote:
> > > > > > >
> > > > > > > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > > > > > > >
> > > > > > > > DIGY
> > > > > > > >
> > > > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> > > larsaaslin@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
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> >
> >
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Marco Dissel <ma...@gmail.com>.
Let's take the sample data from http://goo.gl/UQubj

          f1     f2     f3
          --     --     --
doc1      A      I      1
doc2      A      I      2
doc3      A      I      3
doc4      A      J      1
doc5      A      J      2
doc6      A      J      3
doc7      B      I      1

SimpleFacetedSearch sfs = new SimpleFacetedSearch(_Reader, new
string[] {"f1", "f2", "f3"});
SimpleFacetedSearch.Hits hits = sfs.Search(query);

foreach(Facet facet in hits.Facets){ // groupByFields from constructor

   foreach(FacetTerm facetTerm in facet.FacetTerms){

       WriteLine(facet.Field + facetTerm.Name + facetTerm.HitCount);

   }

}

results in:
f1 - A - 6
f1 - B - 1
f2 - I - 4
f2 - J - 3
f3 - 1 - 3
f3 - 2 - 1
f3 - 3 - 3

>> A *simple* example?

I didn't say it's easy, the opposite..again thanks for your time.

On Wed, May 25, 2011 at 10:55 PM, Digy <di...@gmail.com> wrote:

>
> Sorry Marco,
> I can't see your point. A *simple* example?
>
> DIGY
>
> -----Original Message-----
> From: Marco Dissel [mailto:marco.dissel@gmail.com]
> Sent: Wednesday, May 25, 2011 11:45 PM
> To: lucene-net-user@lucene.apache.org
> Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without using the
> Bits-method
>
> Thank digy!
>
> The current sample is grouping the unique combinations of multiple facets
> fields, but what if you want to create an facet interface like on this
> amazon.com page http://goo.gl/tBhuj ? The number of hits are based on a
> single field query (click on "boxed set" will show 1148 hits)..
>
> Edition
>
>   - [image: Unselected Box]Boxed Set
> (1,148)<
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
>
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
>
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fo
>
> rmat_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
>
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=
> 672573011&ie=UTF8&qid=1306356036&rnid=390118011>
>   - [image: Unselected Box]Full Screen
> (875)<
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
>
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
>
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
>
> at_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
>
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=67
> 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
>   - [image: Unselected Box]Widescreen
> (606)<
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
>
> 672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
>
> K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
>
> at_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
>
> 7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=67
> 2573011&ie=UTF8&qid=1306356036&rnid=390118011>
>
> Region
>
>   - US & CA DVDs: Region 1
> (1,873)<
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
>
> 2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
>
> 81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fe
>
> ature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
>
> 917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011
> &bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
>   - DVDs Playable Outside the US
> (1)<
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C67
>
> 2573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K7
>
> 9MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featur
>
> e_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A129174
>
> 11%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn
> =672573011&ie=UTF8&qid=1306356036&rnid=405390011>
>   - DVDs Playable in any Region
> (62)<
> http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C6
>
> 72573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K
>
> 79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featu
>
> re_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917
>
> 411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bb
> n=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
>
>
> Thanks
>
> On Wed, May 25, 2011 at 12:08 AM, Digy <di...@gmail.com> wrote:
>
> > 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.wu@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 <di...@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.dissel@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 <di...@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 <
> > > karunakerreddyv@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 <di...@gmail.com>
> > > wrote:
> > > > > >
> > > > > > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > > > > > >
> > > > > > > DIGY
> > > > > > >
> > > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> > larsaaslin@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
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> >
>
>

RE: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Digy <di...@gmail.com>.
Sorry Marco,
I can't see your point. A *simple* example?

DIGY

-----Original Message-----
From: Marco Dissel [mailto:marco.dissel@gmail.com] 
Sent: Wednesday, May 25, 2011 11:45 PM
To: lucene-net-user@lucene.apache.org
Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without using the
Bits-method

Thank digy!

The current sample is grouping the unique combinations of multiple facets
fields, but what if you want to create an facet interface like on this
amazon.com page http://goo.gl/tBhuj ? The number of hits are based on a
single field query (click on "boxed set" will show 1148 hits)..

Edition

   - [image: Unselected Box]Boxed Set
(1,148)<http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fo
rmat_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=
672573011&ie=UTF8&qid=1306356036&rnid=390118011>
   - [image: Unselected Box]Full Screen
(875)<http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
at_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=67
2573011&ie=UTF8&qid=1306356036&rnid=390118011>
   - [image: Unselected Box]Widescreen
(606)<http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C
672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81
K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_form
at_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A1291
7411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=67
2573011&ie=UTF8&qid=1306356036&rnid=390118011>

Region

   - US & CA DVDs: Region 1
(1,873)<http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%
2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q
81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_fe
ature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12
917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011
&bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
   - DVDs Playable Outside the US
(1)<http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C67
2573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K7
9MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featur
e_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A129174
11%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn
=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
   - DVDs Playable in any Region
(62)<http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C6
72573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K
79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_featu
re_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917
411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bb
n=672573011&ie=UTF8&qid=1306356036&rnid=405390011>


Thanks

On Wed, May 25, 2011 at 12:08 AM, Digy <di...@gmail.com> wrote:

> 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.wu@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 <di...@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.dissel@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 <di...@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 <
> > karunakerreddyv@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 <di...@gmail.com>
> > wrote:
> > > > >
> > > > > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > > > > >
> > > > > > DIGY
> > > > > >
> > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> larsaaslin@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
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>


Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Marco Dissel <ma...@gmail.com>.
Thank digy!

The current sample is grouping the unique combinations of multiple facets
fields, but what if you want to create an facet interface like on this
amazon.com page http://goo.gl/tBhuj ? The number of hits are based on a
single field query (click on "boxed set" will show 1148 hits)..

Edition

   - [image: Unselected Box]Boxed Set
(1,148)<http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_format_browse-bi_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A388395011&bbn=672573011&ie=UTF8&qid=1306356036&rnid=390118011>
   - [image: Unselected Box]Full Screen
(875)<http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_format_browse-bi_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390120011&bbn=672573011&ie=UTF8&qid=1306356036&rnid=390118011>
   - [image: Unselected Box]Widescreen
(606)<http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_format_browse-bi_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_format_browse-bin%3A390121011&bbn=672573011&ie=UTF8&qid=1306356036&rnid=390118011>

Region

   - US & CA DVDs: Region 1
(1,873)<http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_feature_two_brow_0?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405391011&bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
   - DVDs Playable Outside the US
(1)<http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_feature_two_brow_1?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405393011&bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>
   - DVDs Playable in any Region
(62)<http://www.amazon.com/s/ref=amb_link_85221991_4?ie=UTF8&node=163450%2C672573011&bbn=672573011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=03F2Q81K79MYNMMCJEZZ&pf_rd_t=101&pf_rd_p=1299020482&pf_rd_i=130#/ref=sr_nr_p_n_feature_two_brow_2?rh=n%3A130%2Cn%3A%212334112011%2Cn%3A%212334174011%2Cn%3A12917411%2Cn%3A672573011%2Cn%3A163450%2Cp_n_feature_two_browse-bin%3A405392011&bbn=672573011&ie=UTF8&qid=1306356036&rnid=405390011>


Thanks

On Wed, May 25, 2011 at 12:08 AM, Digy <di...@gmail.com> wrote:

> 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.wu@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 <di...@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.dissel@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 <di...@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 <
> > karunakerreddyv@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 <di...@gmail.com>
> > wrote:
> > > > >
> > > > > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > > > > >
> > > > > > DIGY
> > > > > >
> > > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> larsaaslin@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
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>

RE: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Digy <di...@gmail.com>.
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.wu@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 <di...@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.dissel@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 <di...@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 <
> karunakerreddyv@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 <di...@gmail.com>
> wrote:
> > > >
> > > > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > > > >
> > > > > DIGY
> > > > >
> > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <larsaaslin@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
> > > > > >
> > > > >
> > > >
> > >
> >
>


Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Floyd Wu <fl...@gmail.com>.
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 <di...@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.dissel@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 <di...@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 <
> karunakerreddyv@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 <di...@gmail.com>
> wrote:
> > > >
> > > > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > > > >
> > > > > DIGY
> > > > >
> > > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <larsaaslin@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
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by digy digy <di...@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 <ma...@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 <di...@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 <karunakerreddyv@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 <di...@gmail.com> wrote:
> > >
> > > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > > >
> > > > DIGY
> > > >
> > > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <la...@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
> > > > >
> > > >
> > >
> >
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Marco Dissel <ma...@gmail.com>.
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 <di...@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 <karunakerreddyv@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 <di...@gmail.com> wrote:
> >
> > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > >
> > > DIGY
> > >
> > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <la...@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
> > > >
> > >
> >
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by lars aslin <la...@gmail.com>.
Thanks for your comments Ben,
OpenBitSetDISI demands that a maximum number of results is provided in the
constructor. Dont think thats a problem as long as the highest document id
+1 is used as MaxSearchResultSize. Anyway, thanks for your suggestions.

On Wed, May 25, 2011 at 5:38 PM, Ben West <bw...@yahoo.com> wrote:

> Thanks for sharing your code!
>
> Two suggestions about performance:
> 1. It doesn't look to me like you're caching them. You might want to use a
> CachingWrapperFilter.
> 2. Also, SpanTermQueries are slower than TermQueries and SpanQueryFilters
> slower than QueryWrapperFilters - unless you have in your custom code some
> reason why you want to do a span query, it's probably quicker to just use a
> TermQuery.
>
> Something I'm not sure about: if your categoryBitSet only has
> MaxSearchResultSize hits, then the intersection of search and category might
> have much less than MaxSearchResultSize, right? So you might want to find
> all hits for the categoryBitSet and only limit the query itself.
>
> hth
> -ben
>
>
> ----- Original Message -----
> From: lars aslin <la...@gmail.com>
> To: lucene-net-user@lucene.apache.org
> Cc:
> Sent: Wednesday, May 25, 2011 3:00 AM
> Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without using the
> Bits-method
>
> This is the generic part of my implementation
>
>         public IList<KeyValuePair<string, int>> GetFacets(OpenBitSet
> searchBitSet, IndexReader indexReader, string category, IEnumerable<string>
> categoryValues)
>         {
>             return categoryValues.Select(categoryValue =>
> FacetedSearch(searchBitSet, indexReader, category, categoryValue))
>                 .Select(facet => facet).Where(facet => facet.Value >
> 0).ToList();
>         }
>
>         public KeyValuePair<string,int> FacetedSearch(OpenBitSet
> searchBitSet, IndexReader indexReader, string category, string
> categoryValue)
>         {
>             var categoryQuery = new SpanTermQuery(new Term(category,
> categoryValue));
>             var categoryQueryFilter = new SpanQueryFilter(categoryQuery);
>             var docSetIterator =
> categoryQueryFilter.GetDocIdSet(indexReader).Iterator();
>             var categoryBitSet = new OpenBitSetDISI(docSetIterator,
> FullTextSearchSettings.GetMaxSearchResultSize);
>
>             categoryBitSet.And(searchBitSet);
>             return new KeyValuePair<string, int>(categoryValue,
> (int)categoryBitSet.Cardinality());
>         }
> Not sure this is the best way of doing it. My understanding is that the
> solutions performance rely on the cach functionality for the filters. So
> the
> first search will be a lot more slower than the following. Is this a
> correct
> assumption?
>
>
> On Mon, May 23, 2011 at 12:16 PM, Marco Dissel <marco.dissel@gmail.com
> >wrote:
>
> > Can you share your implementation (if it's generic)
> >
> > Thanks
> > Op 23 mei 2011 11:47 schreef "lars aslin" <la...@gmail.com> het
> > volgende:
> > > Thanks Diggy, have built a solution for faceted searches based on
> > OpenBitSet
> > > now and it seems to run really smooth. Haven't been able run any actual
> > > tests yet but the overall experience is good.
> > >
> > >
> > > On Fri, May 20, 2011 at 2:57 PM, digy digy <di...@gmail.com> wrote:
> > >
> > >> This is a good example of thread hijacking.
> > >>
> > >> These kinds of problems are mostly related to the analyzer used. Try
> to
> > use
> > >> different analyzers like KeywordAnalyzer, WhitespaceAnalyzer(or a
> custom
> > >> one) (Also don't forget to use the same analyzer while indexing and
> > >> searching)
> > >>
> > >> If your field is "not analyzed", you can also try to use TermQuery
> while
> > >> searching.
> > >>
> > >> DIGY
> > >>
> > >> On Fri, May 20, 2011 at 3:36 PM, K a r n a v <
> karunakerreddyv@gmail.com
> > >> >wrote:
> > >>
> > >> > How can we handle special characters like .;: /
> > >> \?"\<>~`*!@#$%^&-_+={}[]|(
> > >> > When I search with hyderabad-india...internally it is removing the
> > char
> > >> '-'
> > >> > and constructing the query like hyderabad india.
> > >> > (Even I've tried with escape char also...but I've failed)
> > >> > could you please give me small example to handle special chars while
> > >> > searching (and while constructing query) ...
> > >> > ...Please help me in this regard.
> > >> >
> > >> >
> > >> >
> > >> > On Fri, May 20, 2011 at 5:56 PM, K a r n a v <
> > karunakerreddyv@gmail.com
> > >> > >wrote:
> > >> >
> > >> > > wow...thx DIGY.. let me chk this ...if it can improve the
> > >> performance...i
> > >> > > will replace my code with OpenBitSitDISI
> > >> > >
> > >> > >
> > >> > > On Fri, May 20, 2011 at 4:31 PM, digy digy <di...@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 <
> > >> > karunakerreddyv@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 <digydigy@gmail.com
> >
> > >> > wrote:
> > >> > >> >
> > >> > >> > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > >> > >> > >
> > >> > >> > > DIGY
> > >> > >> > >
> > >> > >> > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> > >> larsaaslin@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
> > >> > >> > > >
> > >> > >> > >
> > >> > >> >
> > >> > >>
> > >> > >
> > >> > >
> > >> > >
> > >> > > --
> > >> > > *Thanks & Regards*,
> > >> > > *Karunaker Reddy V
> > >> > >
> > >> > > *http://www.flickr.com/photos/karnav/
> > >> > >
> > >> > > *Ooh!!*, and one more thing: *no matter who you are, you were
> built
> > to
> > >> be
> > >> > > brilliant and designed to make a difference in this world*.*
> PLEASE
> > DOT
> > >> > IT
> > >> > > *!
> > >> > >
> > >> >
> > >> >
> > >> >
> > >> > --
> > >> > *Thanks & Regards*,
> > >> > *Karunaker Reddy V
> > >> >
> > >> > *http://www.flickr.com/photos/karnav/
> > >> >
> > >> > *Ooh!!*, and one more thing: *no matter who you are, you were built
> to
> > be
> > >> > brilliant and designed to make a difference in this world*.* PLEASE
> > DOT
> > >> > IT*!
> > >> >
> > >>
> > >
> > > WebRep
> > > Overall rating
> > >
> > > WebRep
> > > Overall rating
> >
>
> WebRep
> Overall rating
>
>

WebRep
Overall rating

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Ben West <bw...@yahoo.com>.
Thanks for sharing your code!

Two suggestions about performance:
1. It doesn't look to me like you're caching them. You might want to use a CachingWrapperFilter. 
2. Also, SpanTermQueries are slower than TermQueries and SpanQueryFilters slower than QueryWrapperFilters - unless you have in your custom code some reason why you want to do a span query, it's probably quicker to just use a TermQuery.

Something I'm not sure about: if your categoryBitSet only has MaxSearchResultSize hits, then the intersection of search and category might have much less than MaxSearchResultSize, right? So you might want to find all hits for the categoryBitSet and only limit the query itself.

hth
-ben


----- Original Message -----
From: lars aslin <la...@gmail.com>
To: lucene-net-user@lucene.apache.org
Cc: 
Sent: Wednesday, May 25, 2011 3:00 AM
Subject: Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

This is the generic part of my implementation

        public IList<KeyValuePair<string, int>> GetFacets(OpenBitSet
searchBitSet, IndexReader indexReader, string category, IEnumerable<string>
categoryValues)
        {
            return categoryValues.Select(categoryValue =>
FacetedSearch(searchBitSet, indexReader, category, categoryValue))
                .Select(facet => facet).Where(facet => facet.Value >
0).ToList();
        }

        public KeyValuePair<string,int> FacetedSearch(OpenBitSet
searchBitSet, IndexReader indexReader, string category, string
categoryValue)
        {
            var categoryQuery = new SpanTermQuery(new Term(category,
categoryValue));
            var categoryQueryFilter = new SpanQueryFilter(categoryQuery);
            var docSetIterator =
categoryQueryFilter.GetDocIdSet(indexReader).Iterator();
            var categoryBitSet = new OpenBitSetDISI(docSetIterator,
FullTextSearchSettings.GetMaxSearchResultSize);

            categoryBitSet.And(searchBitSet);
            return new KeyValuePair<string, int>(categoryValue,
(int)categoryBitSet.Cardinality());
        }
Not sure this is the best way of doing it. My understanding is that the
solutions performance rely on the cach functionality for the filters. So the
first search will be a lot more slower than the following. Is this a correct
assumption?


On Mon, May 23, 2011 at 12:16 PM, Marco Dissel <ma...@gmail.com>wrote:

> Can you share your implementation (if it's generic)
>
> Thanks
> Op 23 mei 2011 11:47 schreef "lars aslin" <la...@gmail.com> het
> volgende:
> > Thanks Diggy, have built a solution for faceted searches based on
> OpenBitSet
> > now and it seems to run really smooth. Haven't been able run any actual
> > tests yet but the overall experience is good.
> >
> >
> > On Fri, May 20, 2011 at 2:57 PM, digy digy <di...@gmail.com> wrote:
> >
> >> This is a good example of thread hijacking.
> >>
> >> These kinds of problems are mostly related to the analyzer used. Try to
> use
> >> different analyzers like KeywordAnalyzer, WhitespaceAnalyzer(or a custom
> >> one) (Also don't forget to use the same analyzer while indexing and
> >> searching)
> >>
> >> If your field is "not analyzed", you can also try to use TermQuery while
> >> searching.
> >>
> >> DIGY
> >>
> >> On Fri, May 20, 2011 at 3:36 PM, K a r n a v <karunakerreddyv@gmail.com
> >> >wrote:
> >>
> >> > How can we handle special characters like .;: /
> >> \?"\<>~`*!@#$%^&-_+={}[]|(
> >> > When I search with hyderabad-india...internally it is removing the
> char
> >> '-'
> >> > and constructing the query like hyderabad india.
> >> > (Even I've tried with escape char also...but I've failed)
> >> > could you please give me small example to handle special chars while
> >> > searching (and while constructing query) ...
> >> > ...Please help me in this regard.
> >> >
> >> >
> >> >
> >> > On Fri, May 20, 2011 at 5:56 PM, K a r n a v <
> karunakerreddyv@gmail.com
> >> > >wrote:
> >> >
> >> > > wow...thx DIGY.. let me chk this ...if it can improve the
> >> performance...i
> >> > > will replace my code with OpenBitSitDISI
> >> > >
> >> > >
> >> > > On Fri, May 20, 2011 at 4:31 PM, digy digy <di...@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 <
> >> > karunakerreddyv@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 <di...@gmail.com>
> >> > wrote:
> >> > >> >
> >> > >> > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> >> > >> > >
> >> > >> > > DIGY
> >> > >> > >
> >> > >> > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> >> larsaaslin@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
> >> > >> > > >
> >> > >> > >
> >> > >> >
> >> > >>
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > *Thanks & Regards*,
> >> > > *Karunaker Reddy V
> >> > >
> >> > > *http://www.flickr.com/photos/karnav/
> >> > >
> >> > > *Ooh!!*, and one more thing: *no matter who you are, you were built
> to
> >> be
> >> > > brilliant and designed to make a difference in this world*.* PLEASE
> DOT
> >> > IT
> >> > > *!
> >> > >
> >> >
> >> >
> >> >
> >> > --
> >> > *Thanks & Regards*,
> >> > *Karunaker Reddy V
> >> >
> >> > *http://www.flickr.com/photos/karnav/
> >> >
> >> > *Ooh!!*, and one more thing: *no matter who you are, you were built to
> be
> >> > brilliant and designed to make a difference in this world*.* PLEASE
> DOT
> >> > IT*!
> >> >
> >>
> >
> > WebRep
> > Overall rating
> >
> > WebRep
> > Overall rating
>

WebRep
Overall rating


Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by lars aslin <la...@gmail.com>.
This is the generic part of my implementation

        public IList<KeyValuePair<string, int>> GetFacets(OpenBitSet
searchBitSet, IndexReader indexReader, string category, IEnumerable<string>
categoryValues)
        {
            return categoryValues.Select(categoryValue =>
FacetedSearch(searchBitSet, indexReader, category, categoryValue))
                .Select(facet => facet).Where(facet => facet.Value >
0).ToList();
        }

        public KeyValuePair<string,int> FacetedSearch(OpenBitSet
searchBitSet, IndexReader indexReader, string category, string
categoryValue)
        {
            var categoryQuery = new SpanTermQuery(new Term(category,
categoryValue));
            var categoryQueryFilter = new SpanQueryFilter(categoryQuery);
            var docSetIterator =
categoryQueryFilter.GetDocIdSet(indexReader).Iterator();
            var categoryBitSet = new OpenBitSetDISI(docSetIterator,
FullTextSearchSettings.GetMaxSearchResultSize);

            categoryBitSet.And(searchBitSet);
            return new KeyValuePair<string, int>(categoryValue,
(int)categoryBitSet.Cardinality());
        }
Not sure this is the best way of doing it. My understanding is that the
solutions performance rely on the cach functionality for the filters. So the
first search will be a lot more slower than the following. Is this a correct
assumption?


On Mon, May 23, 2011 at 12:16 PM, Marco Dissel <ma...@gmail.com>wrote:

> Can you share your implementation (if it's generic)
>
> Thanks
> Op 23 mei 2011 11:47 schreef "lars aslin" <la...@gmail.com> het
> volgende:
> > Thanks Diggy, have built a solution for faceted searches based on
> OpenBitSet
> > now and it seems to run really smooth. Haven't been able run any actual
> > tests yet but the overall experience is good.
> >
> >
> > On Fri, May 20, 2011 at 2:57 PM, digy digy <di...@gmail.com> wrote:
> >
> >> This is a good example of thread hijacking.
> >>
> >> These kinds of problems are mostly related to the analyzer used. Try to
> use
> >> different analyzers like KeywordAnalyzer, WhitespaceAnalyzer(or a custom
> >> one) (Also don't forget to use the same analyzer while indexing and
> >> searching)
> >>
> >> If your field is "not analyzed", you can also try to use TermQuery while
> >> searching.
> >>
> >> DIGY
> >>
> >> On Fri, May 20, 2011 at 3:36 PM, K a r n a v <karunakerreddyv@gmail.com
> >> >wrote:
> >>
> >> > How can we handle special characters like .;: /
> >> \?"\<>~`*!@#$%^&-_+={}[]|(
> >> > When I search with hyderabad-india...internally it is removing the
> char
> >> '-'
> >> > and constructing the query like hyderabad india.
> >> > (Even I've tried with escape char also...but I've failed)
> >> > could you please give me small example to handle special chars while
> >> > searching (and while constructing query) ...
> >> > ...Please help me in this regard.
> >> >
> >> >
> >> >
> >> > On Fri, May 20, 2011 at 5:56 PM, K a r n a v <
> karunakerreddyv@gmail.com
> >> > >wrote:
> >> >
> >> > > wow...thx DIGY.. let me chk this ...if it can improve the
> >> performance...i
> >> > > will replace my code with OpenBitSitDISI
> >> > >
> >> > >
> >> > > On Fri, May 20, 2011 at 4:31 PM, digy digy <di...@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 <
> >> > karunakerreddyv@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 <di...@gmail.com>
> >> > wrote:
> >> > >> >
> >> > >> > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> >> > >> > >
> >> > >> > > DIGY
> >> > >> > >
> >> > >> > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> >> larsaaslin@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
> >> > >> > > >
> >> > >> > >
> >> > >> >
> >> > >>
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > *Thanks & Regards*,
> >> > > *Karunaker Reddy V
> >> > >
> >> > > *http://www.flickr.com/photos/karnav/
> >> > >
> >> > > *Ooh!!*, and one more thing: *no matter who you are, you were built
> to
> >> be
> >> > > brilliant and designed to make a difference in this world*.* PLEASE
> DOT
> >> > IT
> >> > > *!
> >> > >
> >> >
> >> >
> >> >
> >> > --
> >> > *Thanks & Regards*,
> >> > *Karunaker Reddy V
> >> >
> >> > *http://www.flickr.com/photos/karnav/
> >> >
> >> > *Ooh!!*, and one more thing: *no matter who you are, you were built to
> be
> >> > brilliant and designed to make a difference in this world*.* PLEASE
> DOT
> >> > IT*!
> >> >
> >>
> >
> > WebRep
> > Overall rating
> >
> > WebRep
> > Overall rating
>

WebRep
Overall rating

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Marco Dissel <ma...@gmail.com>.
Thanks! Showing a sample with multiple facets/groupby fields would be a nice
bonus!

On Mon, May 23, 2011 at 12:22 PM, digy digy <di...@gmail.com> wrote:

> See https://issues.apache.org/jira/browse/LUCENENET-415
>
> DIGY
>
> On Mon, May 23, 2011 at 1:16 PM, Marco Dissel <marco.dissel@gmail.com
> >wrote:
>
> > Can you share your implementation (if it's generic)
> >
> > Thanks
> > Op 23 mei 2011 11:47 schreef "lars aslin" <la...@gmail.com> het
> > volgende:
> > > Thanks Diggy, have built a solution for faceted searches based on
> > OpenBitSet
> > > now and it seems to run really smooth. Haven't been able run any actual
> > > tests yet but the overall experience is good.
> > >
> > >
> > > On Fri, May 20, 2011 at 2:57 PM, digy digy <di...@gmail.com> wrote:
> > >
> > >> This is a good example of thread hijacking.
> > >>
> > >> These kinds of problems are mostly related to the analyzer used. Try
> to
> > use
> > >> different analyzers like KeywordAnalyzer, WhitespaceAnalyzer(or a
> custom
> > >> one) (Also don't forget to use the same analyzer while indexing and
> > >> searching)
> > >>
> > >> If your field is "not analyzed", you can also try to use TermQuery
> while
> > >> searching.
> > >>
> > >> DIGY
> > >>
> > >> On Fri, May 20, 2011 at 3:36 PM, K a r n a v <
> karunakerreddyv@gmail.com
> > >> >wrote:
> > >>
> > >> > How can we handle special characters like .;: /
> > >> \?"\<>~`*!@#$%^&-_+={}[]|(
> > >> > When I search with hyderabad-india...internally it is removing the
> > char
> > >> '-'
> > >> > and constructing the query like hyderabad india.
> > >> > (Even I've tried with escape char also...but I've failed)
> > >> > could you please give me small example to handle special chars while
> > >> > searching (and while constructing query) ...
> > >> > ...Please help me in this regard.
> > >> >
> > >> >
> > >> >
> > >> > On Fri, May 20, 2011 at 5:56 PM, K a r n a v <
> > karunakerreddyv@gmail.com
> > >> > >wrote:
> > >> >
> > >> > > wow...thx DIGY.. let me chk this ...if it can improve the
> > >> performance...i
> > >> > > will replace my code with OpenBitSitDISI
> > >> > >
> > >> > >
> > >> > > On Fri, May 20, 2011 at 4:31 PM, digy digy <di...@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 <
> > >> > karunakerreddyv@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 <digydigy@gmail.com
> >
> > >> > wrote:
> > >> > >> >
> > >> > >> > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > >> > >> > >
> > >> > >> > > DIGY
> > >> > >> > >
> > >> > >> > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> > >> larsaaslin@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
> > >> > >> > > >
> > >> > >> > >
> > >> > >> >
> > >> > >>
> > >> > >
> > >> > >
> > >> > >
> > >> > > --
> > >> > > *Thanks & Regards*,
> > >> > > *Karunaker Reddy V
> > >> > >
> > >> > > *http://www.flickr.com/photos/karnav/
> > >> > >
> > >> > > *Ooh!!*, and one more thing: *no matter who you are, you were
> built
> > to
> > >> be
> > >> > > brilliant and designed to make a difference in this world*.*
> PLEASE
> > DOT
> > >> > IT
> > >> > > *!
> > >> > >
> > >> >
> > >> >
> > >> >
> > >> > --
> > >> > *Thanks & Regards*,
> > >> > *Karunaker Reddy V
> > >> >
> > >> > *http://www.flickr.com/photos/karnav/
> > >> >
> > >> > *Ooh!!*, and one more thing: *no matter who you are, you were built
> to
> > be
> > >> > brilliant and designed to make a difference in this world*.* PLEASE
> > DOT
> > >> > IT*!
> > >> >
> > >>
> > >
> > > WebRep
> > > Overall rating
> > >
> > > WebRep
> > > Overall rating
> >
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by digy digy <di...@gmail.com>.
See https://issues.apache.org/jira/browse/LUCENENET-415

DIGY

On Mon, May 23, 2011 at 1:16 PM, Marco Dissel <ma...@gmail.com>wrote:

> Can you share your implementation (if it's generic)
>
> Thanks
> Op 23 mei 2011 11:47 schreef "lars aslin" <la...@gmail.com> het
> volgende:
> > Thanks Diggy, have built a solution for faceted searches based on
> OpenBitSet
> > now and it seems to run really smooth. Haven't been able run any actual
> > tests yet but the overall experience is good.
> >
> >
> > On Fri, May 20, 2011 at 2:57 PM, digy digy <di...@gmail.com> wrote:
> >
> >> This is a good example of thread hijacking.
> >>
> >> These kinds of problems are mostly related to the analyzer used. Try to
> use
> >> different analyzers like KeywordAnalyzer, WhitespaceAnalyzer(or a custom
> >> one) (Also don't forget to use the same analyzer while indexing and
> >> searching)
> >>
> >> If your field is "not analyzed", you can also try to use TermQuery while
> >> searching.
> >>
> >> DIGY
> >>
> >> On Fri, May 20, 2011 at 3:36 PM, K a r n a v <karunakerreddyv@gmail.com
> >> >wrote:
> >>
> >> > How can we handle special characters like .;: /
> >> \?"\<>~`*!@#$%^&-_+={}[]|(
> >> > When I search with hyderabad-india...internally it is removing the
> char
> >> '-'
> >> > and constructing the query like hyderabad india.
> >> > (Even I've tried with escape char also...but I've failed)
> >> > could you please give me small example to handle special chars while
> >> > searching (and while constructing query) ...
> >> > ...Please help me in this regard.
> >> >
> >> >
> >> >
> >> > On Fri, May 20, 2011 at 5:56 PM, K a r n a v <
> karunakerreddyv@gmail.com
> >> > >wrote:
> >> >
> >> > > wow...thx DIGY.. let me chk this ...if it can improve the
> >> performance...i
> >> > > will replace my code with OpenBitSitDISI
> >> > >
> >> > >
> >> > > On Fri, May 20, 2011 at 4:31 PM, digy digy <di...@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 <
> >> > karunakerreddyv@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 <di...@gmail.com>
> >> > wrote:
> >> > >> >
> >> > >> > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> >> > >> > >
> >> > >> > > DIGY
> >> > >> > >
> >> > >> > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> >> larsaaslin@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
> >> > >> > > >
> >> > >> > >
> >> > >> >
> >> > >>
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > *Thanks & Regards*,
> >> > > *Karunaker Reddy V
> >> > >
> >> > > *http://www.flickr.com/photos/karnav/
> >> > >
> >> > > *Ooh!!*, and one more thing: *no matter who you are, you were built
> to
> >> be
> >> > > brilliant and designed to make a difference in this world*.* PLEASE
> DOT
> >> > IT
> >> > > *!
> >> > >
> >> >
> >> >
> >> >
> >> > --
> >> > *Thanks & Regards*,
> >> > *Karunaker Reddy V
> >> >
> >> > *http://www.flickr.com/photos/karnav/
> >> >
> >> > *Ooh!!*, and one more thing: *no matter who you are, you were built to
> be
> >> > brilliant and designed to make a difference in this world*.* PLEASE
> DOT
> >> > IT*!
> >> >
> >>
> >
> > WebRep
> > Overall rating
> >
> > WebRep
> > Overall rating
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by Marco Dissel <ma...@gmail.com>.
Can you share your implementation (if it's generic)

Thanks
Op 23 mei 2011 11:47 schreef "lars aslin" <la...@gmail.com> het
volgende:
> Thanks Diggy, have built a solution for faceted searches based on
OpenBitSet
> now and it seems to run really smooth. Haven't been able run any actual
> tests yet but the overall experience is good.
>
>
> On Fri, May 20, 2011 at 2:57 PM, digy digy <di...@gmail.com> wrote:
>
>> This is a good example of thread hijacking.
>>
>> These kinds of problems are mostly related to the analyzer used. Try to
use
>> different analyzers like KeywordAnalyzer, WhitespaceAnalyzer(or a custom
>> one) (Also don't forget to use the same analyzer while indexing and
>> searching)
>>
>> If your field is "not analyzed", you can also try to use TermQuery while
>> searching.
>>
>> DIGY
>>
>> On Fri, May 20, 2011 at 3:36 PM, K a r n a v <karunakerreddyv@gmail.com
>> >wrote:
>>
>> > How can we handle special characters like .;: /
>> \?"\<>~`*!@#$%^&-_+={}[]|(
>> > When I search with hyderabad-india...internally it is removing the char
>> '-'
>> > and constructing the query like hyderabad india.
>> > (Even I've tried with escape char also...but I've failed)
>> > could you please give me small example to handle special chars while
>> > searching (and while constructing query) ...
>> > ...Please help me in this regard.
>> >
>> >
>> >
>> > On Fri, May 20, 2011 at 5:56 PM, K a r n a v <karunakerreddyv@gmail.com
>> > >wrote:
>> >
>> > > wow...thx DIGY.. let me chk this ...if it can improve the
>> performance...i
>> > > will replace my code with OpenBitSitDISI
>> > >
>> > >
>> > > On Fri, May 20, 2011 at 4:31 PM, digy digy <di...@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 <
>> > karunakerreddyv@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 <di...@gmail.com>
>> > wrote:
>> > >> >
>> > >> > > Take a look at OpenBitSetDISI in Lucene.Net.Util
>> > >> > >
>> > >> > > DIGY
>> > >> > >
>> > >> > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
>> larsaaslin@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
>> > >> > > >
>> > >> > >
>> > >> >
>> > >>
>> > >
>> > >
>> > >
>> > > --
>> > > *Thanks & Regards*,
>> > > *Karunaker Reddy V
>> > >
>> > > *http://www.flickr.com/photos/karnav/
>> > >
>> > > *Ooh!!*, and one more thing: *no matter who you are, you were built
to
>> be
>> > > brilliant and designed to make a difference in this world*.* PLEASE
DOT
>> > IT
>> > > *!
>> > >
>> >
>> >
>> >
>> > --
>> > *Thanks & Regards*,
>> > *Karunaker Reddy V
>> >
>> > *http://www.flickr.com/photos/karnav/
>> >
>> > *Ooh!!*, and one more thing: *no matter who you are, you were built to
be
>> > brilliant and designed to make a difference in this world*.* PLEASE DOT
>> > IT*!
>> >
>>
>
> WebRep
> Overall rating
>
> WebRep
> Overall rating

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by lars aslin <la...@gmail.com>.
Thanks Diggy, have built a solution for faceted searches based on OpenBitSet
now and it seems to run really smooth. Haven't been able run any actual
tests yet but the overall experience is good.


On Fri, May 20, 2011 at 2:57 PM, digy digy <di...@gmail.com> wrote:

> This is a good example of thread hijacking.
>
> These kinds of problems are mostly related to the analyzer used. Try to use
> different analyzers like KeywordAnalyzer, WhitespaceAnalyzer(or a custom
> one) (Also don't forget to use the same analyzer while indexing and
> searching)
>
> If your field is "not analyzed", you can also try to use TermQuery while
> searching.
>
> DIGY
>
> On Fri, May 20, 2011 at 3:36 PM, K a r n a v <karunakerreddyv@gmail.com
> >wrote:
>
> > How can we handle special characters like .;: /
> \?"\<>~`*!@#$%^&-_+={}[]|(
> > When I search with hyderabad-india...internally it is removing the char
> '-'
> > and constructing the query like  hyderabad india.
> > (Even I've tried with escape char also...but I've failed)
> > could you please give me small example to handle special chars while
> > searching (and while constructing query) ...
> > ...Please help me in this regard.
> >
> >
> >
> > On Fri, May 20, 2011 at 5:56 PM, K a r n a v <karunakerreddyv@gmail.com
> > >wrote:
> >
> > > wow...thx DIGY.. let me chk this ...if it can improve the
> performance...i
> > > will replace my code with OpenBitSitDISI
> > >
> > >
> > > On Fri, May 20, 2011 at 4:31 PM, digy digy <di...@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 <
> > karunakerreddyv@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 <di...@gmail.com>
> > wrote:
> > >> >
> > >> > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > >> > >
> > >> > > DIGY
> > >> > >
> > >> > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <
> larsaaslin@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
> > >> > > >
> > >> > >
> > >> >
> > >>
> > >
> > >
> > >
> > > --
> > > *Thanks & Regards*,
> > > *Karunaker Reddy V
> > >
> > > *http://www.flickr.com/photos/karnav/
> > >
> > > *Ooh!!*, and one more thing: *no matter who you are, you were built to
> be
> > > brilliant and designed to make a difference in this world*.* PLEASE DOT
> > IT
> > > *!
> > >
> >
> >
> >
> > --
> > *Thanks & Regards*,
> > *Karunaker Reddy V
> >
> > *http://www.flickr.com/photos/karnav/
> >
> > *Ooh!!*, and one more thing: *no matter who you are, you were built to be
> > brilliant and designed to make a difference in this world*.* PLEASE DOT
> > IT*!
> >
>

WebRep
Overall rating

WebRep
Overall rating

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by digy digy <di...@gmail.com>.
This is a good example of thread hijacking.

These kinds of problems are mostly related to the analyzer used. Try to use
different analyzers like KeywordAnalyzer, WhitespaceAnalyzer(or a custom
one) (Also don't forget to use the same analyzer while indexing and
searching)

If your field is "not analyzed", you can also try to use TermQuery while
searching.

DIGY

On Fri, May 20, 2011 at 3:36 PM, K a r n a v <ka...@gmail.com>wrote:

> How can we handle special characters like .;: / \?"\<>~`*!@#$%^&-_+={}[]|(
> When I search with hyderabad-india...internally it is removing the char '-'
> and constructing the query like  hyderabad india.
> (Even I've tried with escape char also...but I've failed)
> could you please give me small example to handle special chars while
> searching (and while constructing query) ...
> ...Please help me in this regard.
>
>
>
> On Fri, May 20, 2011 at 5:56 PM, K a r n a v <karunakerreddyv@gmail.com
> >wrote:
>
> > wow...thx DIGY.. let me chk this ...if it can improve the performance...i
> > will replace my code with OpenBitSitDISI
> >
> >
> > On Fri, May 20, 2011 at 4:31 PM, digy digy <di...@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 <
> karunakerreddyv@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 <di...@gmail.com>
> wrote:
> >> >
> >> > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> >> > >
> >> > > DIGY
> >> > >
> >> > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <la...@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
> >> > > >
> >> > >
> >> >
> >>
> >
> >
> >
> > --
> > *Thanks & Regards*,
> > *Karunaker Reddy V
> >
> > *http://www.flickr.com/photos/karnav/
> >
> > *Ooh!!*, and one more thing: *no matter who you are, you were built to be
> > brilliant and designed to make a difference in this world*.* PLEASE DOT
> IT
> > *!
> >
>
>
>
> --
> *Thanks & Regards*,
> *Karunaker Reddy V
>
> *http://www.flickr.com/photos/karnav/
>
> *Ooh!!*, and one more thing: *no matter who you are, you were built to be
> brilliant and designed to make a difference in this world*.* PLEASE DOT
> IT*!
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by K a r n a v <ka...@gmail.com>.
How can we handle special characters like .;: / \?"\<>~`*!@#$%^&-_+={}[]|(
When I search with hyderabad-india...internally it is removing the char '-'
and constructing the query like  hyderabad india.
(Even I've tried with escape char also...but I've failed)
could you please give me small example to handle special chars while
searching (and while constructing query) ...
...Please help me in this regard.



On Fri, May 20, 2011 at 5:56 PM, K a r n a v <ka...@gmail.com>wrote:

> wow...thx DIGY.. let me chk this ...if it can improve the performance...i
> will replace my code with OpenBitSitDISI
>
>
> On Fri, May 20, 2011 at 4:31 PM, digy digy <di...@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 <karunakerreddyv@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 <di...@gmail.com> wrote:
>> >
>> > > Take a look at OpenBitSetDISI in Lucene.Net.Util
>> > >
>> > > DIGY
>> > >
>> > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <la...@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
>> > > >
>> > >
>> >
>>
>
>
>
> --
> *Thanks & Regards*,
> *Karunaker Reddy V
>
> *http://www.flickr.com/photos/karnav/
>
> *Ooh!!*, and one more thing: *no matter who you are, you were built to be
> brilliant and designed to make a difference in this world*.* PLEASE DOT IT
> *!
>



-- 
*Thanks & Regards*,
*Karunaker Reddy V

*http://www.flickr.com/photos/karnav/

*Ooh!!*, and one more thing: *no matter who you are, you were built to be
brilliant and designed to make a difference in this world*.* PLEASE DOT IT*!

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by K a r n a v <ka...@gmail.com>.
wow...thx DIGY.. let me chk this ...if it can improve the performance...i
will replace my code with OpenBitSitDISI

On Fri, May 20, 2011 at 4:31 PM, digy digy <di...@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 <karunakerreddyv@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 <di...@gmail.com> wrote:
> >
> > > Take a look at OpenBitSetDISI in Lucene.Net.Util
> > >
> > > DIGY
> > >
> > > On Fri, May 20, 2011 at 10:20 AM, lars aslin <la...@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
> > > >
> > >
> >
>



-- 
*Thanks & Regards*,
*Karunaker Reddy V

*http://www.flickr.com/photos/karnav/

*Ooh!!*, and one more thing: *no matter who you are, you were built to be
brilliant and designed to make a difference in this world*.* PLEASE DOT IT*!

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by digy digy <di...@gmail.com>.
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 <ka...@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 <di...@gmail.com> wrote:
>
> > Take a look at OpenBitSetDISI in Lucene.Net.Util
> >
> > DIGY
> >
> > On Fri, May 20, 2011 at 10:20 AM, lars aslin <la...@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
> > >
> >
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by K a r n a v <ka...@gmail.com>.
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 <di...@gmail.com> wrote:

> Take a look at OpenBitSetDISI in Lucene.Net.Util
>
> DIGY
>
> On Fri, May 20, 2011 at 10:20 AM, lars aslin <la...@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
> >
>

Re: [Lucene.Net] Faceted Search in Lucene.NET without using the Bits-method

Posted by digy digy <di...@gmail.com>.
Take a look at OpenBitSetDISI in Lucene.Net.Util

DIGY

On Fri, May 20, 2011 at 10:20 AM, lars aslin <la...@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
>