lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Schimke, Danny" <Danny.Schi...@incowia.com>
Subject Re: Faceted Search: count direct matches/member für result nodes
Date Tue, 28 May 2013 09:05:09 GMT

Hello Shai,

here my scenario:

There are persons. Each person can be a member of 0..n groups. On the frontend there are 2
different views. One is hierarchical, the other one is a list (flat). These groups should
be shown as facets (how many persons are member of a group).

A further option (on frontend) is, that the view, either a list or a hiearchie should be switchable
in their visibility between direct memberships (only show groups without their parents or
the parents should have zero as count if it has no direct member) and indirect memberships
(show all groups even if they have no direct members in search result).

Today I spoke with a coworker: maybe it is possible to hold 2 different category lists - one
for direct members only (flat list, category without category path: instead it holds only
a string without delemiter), the other one for indirect membership (hierarchical categories)
and access them based on required results?

If something isn't clear, please ask and I'll explain obscurities.
Thanks a lot for spent your precious time for solve my problem!

-Danny


-----Ursprüngliche Nachricht-----
Von: Shai Erera [mailto:serera@gmail.com] 
Gesendet: Dienstag, 28. Mai 2013 09:13
An: java-user@lucene.apache.org
Betreff: Re: Faceted Search: count direct matches/member für result nodes

Danny, can you try to describe your problem again? I don't think overriding
OrdinalPolicy is something that you want to do in general. If you can,
please provide a short example (even in text) with 1-2 documents, with
their facets and what you're trying to achieve.

Shai


On Tue, May 28, 2013 at 9:25 AM, Schimke, Danny
<Danny.Schimke@incowia.com>wrote:

>
> Good Morning,
>
> thank you very much!! I got it so far, that the result changed by using
> the different ordinal policies, but they're not correct so far.
>
> I think it does not work, because one lucene document can have one or even
> more categories in my indexing routine and I think this causes faulty
> counts!?
>
> I'm a little frustrated, that faceted search have to be that complicated.
>
> Maybe someone can check my independent java project if I attach it to this
> mail (if it is accessible then?) for helping me figure out how to achieve
> my goals.
>
> Thanks a lot and sorry for asking THAT  much!
> -Danny
>
>
> -----Ursprüngliche Nachricht-----
> Von: Shai Erera [mailto:serera@gmail.com]
> Gesendet: Montag, 27. Mai 2013 15:18
> An: java-user@lucene.apache.org
> Betreff: Re: Faceted Search: count direct matches/member für result nodes
>
> Hi
>
> To override OrdinalPolicy you need to do the following:
>
> FacetIndexingParams fip = new FacetIndexingParams() {
>   public CategoryListParams getCategoryListParams(CategoryPath) {
>     return new CategoryListParams() {
>       public OrdinalPolicy getOrdinalPolicy(String) {}
>     }
>   }
> }
>
> BTW, in the code example you pasted, you don't need to add the categories
> first to taxoWriter. It's enough to call facetFields.addFields(), it will
> take care of adding the categories to the taxonomy as well.
>
> HTH,
> Shai
>
>
> On Mon, May 27, 2013 at 4:11 PM, Schimke, Danny
> <Danny.Schimke@incowia.com>wrote:
>
> > Hi,
> >
> > currently I have time to try out your suggestions. First I want try using
> > the advice using "OrdinalPolicy".
> >
> > But I have problems defining the Params FacetIndexingParams. How do I
> > create those params with the required OrdinalPolicy?
> >
> > I already searched a lot, but found no solution yet. Here is a small
> > snipped of code for indexing:
> >
> > List<CategoryPath> categories = new ArrayList<CategoryPath>();
> > for (String path : paths) {
> >   CategoryPath cat = new CategoryPath(FIELD_GROUP_ID + "/" + path, '/');
> >   categories.add(cat);
> > }
> > for (CategoryPath path : categories) {
> >   taxoWriter.addCategory(path);
> > }
> > ...
> > // TODO FacetIndexingParams need to be added here...
> > FacetFields ff = new FacetFields(taxoWriter);
> > ff.addFields(doc, categories);
> >
> > Thanks a lot in advance!
> > -Danny
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Nicola Buso [mailto:nbuso@ebi.ac.uk]
> > Gesendet: Donnerstag, 25. April 2013 12:51
> > An: java-user@lucene.apache.org
> > Betreff: Re: Faceted Search: count direct matches/member für result nodes
> >
> > Hi,
> >
> > which version of Lucene?
> >
> > Check the OrdinalPolicy you are using in FacetIndexingParams at indexing
> > time.
> >
> > I think you should use: NonTopLevelOrdinalPolicy in lucene 3.6.1 or
> > OrdinalPolicy.ALL_BUT_DIMENSION in lucene 4.2.1
> >
> >
> >
> > Nicola.
> >
> >
> > On Thu, 2013-04-25 at 08:32 +0200, Schimke, Danny wrote:
> > > Hi,
> > >
> > >
> > >
> > > I am new to lucene. I've done some basics so far. Currently I have to
> > deal with Faceted Search.
> > >
> > >
> > >
> > > Given:
> > >
> > > For example I have the following categories:
> > >
> > >
> > >
> > > Root
> > >
> > > Root/idA/
> > >
> > > Root/idA/idB
> > >
> > > Root/idA/idB/idC
> > >
> > >
> > >
> > > Scenario:
> > >
> > > The search result delivers the folowing FacetResult for example:
> > >
> > >
> > >
> > > Root (5)
> > >
> > > Root/idA (5)
> > >
> > > Root/idA/idB (3)
> > >
> > > Root/idA/idB/idC (3)
> > >
> > >
> > >
> > > That means 2 direct matches for Root/idA and 3 direct matches for
> > Root/idA/idB/idC.
> > >
> > >
> > >
> > > But I want ability to get the count that one category exactly has,
> > without consideration of the subcategories (only "direct" member), e.g.:
> > >
> > >
> > >
> > > Root (0)
> > >
> > > Root/idA (2)
> > >
> > > Root/idA/idB (0)
> > >
> > > Root/idA/idB/idC (3)
> > >
> > >
> > >
> > > Maybe there is a standard way don't calculate this by hand in
> dependence
> > to subcategories?
> > >
> > >
> > >
> > > How can I achieve this?
> > >
> > > Thanks a lot in advance!
> > >
> > >
> > >
> > > -Danny
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message