You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Em <ma...@yahoo.de> on 2011/04/20 17:03:57 UTC

Multiple Tags and Facets

Hello,

I watched an online video with Chris Hostsetter from Lucidimagination. He
showed the possibility of having some Facets that exclude *all* filter while
also having some Facets that take care of some of the set filters while
ignoring other filters.

Unfortunately the Webinar did not explain how they made this and I wasn't
able to give a filter/facet more than one tag.

Here is an example:

Facets and Filters: DocType, Author

Facet:
- Author
-- George (10)
-- Brian (12)
-- Christian (78)
-- Julia (2)

-Doctype
-- PDF (70)
-- ODT (10)
-- Word (20)
-- JPEG (1)
-- PNG (1)

When clicking on "Julia" I would like to achieve the following:
Facet:
- Author
-- George (10)
-- Brian (12)
-- Christian (78)
-- Julia (2)
---- Julia's Doctypes:
------ JPEG (1)
------ PNG (1)

-Doctype
-- PDF (70)
-- ODT (10)
-- Word (20)
-- JPEG (1)
-- PNG (1)

Another example which adds special options to your GUI could be as
following:
Imagine a fashion store.
If you search for "shirt" you get a color-facet:

colors:
- red (19)
- green (12)
- blue (4)
- black (2)

As well as a brand-facet:

brands:
- puma (18)
- nike (19)

When I click on the red color-facet, I would like to get the following back:
colors:
- red (19)
- green (12)*
- blue (4)*
- black (2)*

brands:
- puma (18)*
- nike (19)

All those filters marked by an "*" could be displayed half-transparent or so
- they just show the user that those filter-options exist for his/her search
but aren't included in the result-set, since he/she excluded them by
clicking the "red" filter.

This case is more interesting, if not all red shirts were from nike. 
This way you can show the user that i.e. 8 of 19 red - shirts are from the
brand you selected/you see 8 of 19 red shirts.

I hope I explained what I want to achive.

Thank you!

--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-Tags-and-Facets-tp2843130p2843130.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple Tags and Facets

Posted by Em <ma...@yahoo.de>.
Hi Jay,

thank you for your reply.

We most enhance your example to reproduce what I mean:

You got the following facets:

project:
- Solr
- Lucene
- Nutch
- Mahout

source:
- Documentation
- Mailinglist
- Wiki
- Commercial Websites

What I want now is: When I click on Solr + Documentation
(fq={tag=p}project:Solr&fq={tag=s}source:Documentation), I want to get back
a result-set where I on the one hand see that there are no matches for
Mahout given the filter queries.
On the other hand I also want to see that there are results available for my
search but not for the current filters.

This information is usefull for creating a powerfull UI:
You can show the user that there is possibly valuable information available
on commercial websites but they are excluded from the current search.
Another point is that you can "fix" your UI: You always show all facets
relevant to the current search, no matter which of them are active.
Those who do not apply anymore to the given result-set (like Mahout in our
example) still remain in the list of available projects but are marked as
unuasable (displayed in smooth gray or something like that to show that they
are inactive).

My problem is that I do not know how to create such a user-experience,
because, if I add another dimension (like the source-facet) things are
getting complicated.

Since Hoss showed in the Mastering Facets Webinar that such cross-taggings
are possible, I thought that this is an already built-in option for Solr. 

Regards,
Em

--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-Tags-and-Facets-tp2843130p2848085.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple Tags and Facets

Posted by Jay Hill <ja...@gmail.com>.
I don't think I understand what you're trying to do. Are you trying to
preserve all facets after a user clicks on a facet, and thereby triggers a
filter query, which excludes the other facets? If that's the case, you can
use local parameters to tag the filter queries so they are not used for the
facets:

Let's say I have the following facets:
- Solr
- Lucene
- Nutch
- Mahout

And I do a search for "solr".

All of these links will have a filter query:
- Solr [ ?q=solr&fq=project:solr ]
- Lucene [ ?q=solr&fq=project:lucene ]
- Nutch [ ?q=solr&fq=project:nutch ]
- Mahout [ ?q=solr&fq=project:mahout ]

But if a user clicks on the "Solr" facet, the resulting query will exclude
the other facets, so you only see this facet:
- Solr

By using local parameters like this:

?q=solr&fq={!tag=myTag}project:solr &facet=on&facet.field{!ex=myTag}=project

I can preserve all my facets, so that my query is filtered but all facets
still remain:
- Solr
- Lucene
- Nutch
- Mahout

Hope this helps, but I'm not sure that's what you were after.

-Jay



On Wed, Apr 20, 2011 at 8:03 AM, Em <ma...@yahoo.de> wrote:

> Hello,
>
> I watched an online video with Chris Hostsetter from Lucidimagination. He
> showed the possibility of having some Facets that exclude *all* filter
> while
> also having some Facets that take care of some of the set filters while
> ignoring other filters.
>
> Unfortunately the Webinar did not explain how they made this and I wasn't
> able to give a filter/facet more than one tag.
>
> Here is an example:
>
> Facets and Filters: DocType, Author
>
> Facet:
> - Author
> -- George (10)
> -- Brian (12)
> -- Christian (78)
> -- Julia (2)
>
> -Doctype
> -- PDF (70)
> -- ODT (10)
> -- Word (20)
> -- JPEG (1)
> -- PNG (1)
>
> When clicking on "Julia" I would like to achieve the following:
> Facet:
> - Author
> -- George (10)
> -- Brian (12)
> -- Christian (78)
> -- Julia (2)
> ---- Julia's Doctypes:
> ------ JPEG (1)
> ------ PNG (1)
>
> -Doctype
> -- PDF (70)
> -- ODT (10)
> -- Word (20)
> -- JPEG (1)
> -- PNG (1)
>
> Another example which adds special options to your GUI could be as
> following:
> Imagine a fashion store.
> If you search for "shirt" you get a color-facet:
>
> colors:
> - red (19)
> - green (12)
> - blue (4)
> - black (2)
>
> As well as a brand-facet:
>
> brands:
> - puma (18)
> - nike (19)
>
> When I click on the red color-facet, I would like to get the following
> back:
> colors:
> - red (19)
> - green (12)*
> - blue (4)*
> - black (2)*
>
> brands:
> - puma (18)*
> - nike (19)
>
> All those filters marked by an "*" could be displayed half-transparent or
> so
> - they just show the user that those filter-options exist for his/her
> search
> but aren't included in the result-set, since he/she excluded them by
> clicking the "red" filter.
>
> This case is more interesting, if not all red shirts were from nike.
> This way you can show the user that i.e. 8 of 19 red - shirts are from the
> brand you selected/you see 8 of 19 red shirts.
>
> I hope I explained what I want to achive.
>
> Thank you!
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Multiple-Tags-and-Facets-tp2843130p2843130.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Multiple Tags and Facets

Posted by Em <ma...@yahoo.de>.
Are there no ideas of how to use multiple tags per filter or to combine some
tags for excluding more than one filter per facet?

Regards,
Em

--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-Tags-and-Facets-tp2843130p2847569.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple Tags and Facets

Posted by Em <ma...@yahoo.de>.
Thank you Hoss.
I will try the comma-separated thing out. It seems to be what I searched
for. :)

Regards,
Em


Chris Hostetter-3 wrote:
> 
> : I watched an online video with Chris Hostsetter from Lucidimagination.
> He
> : showed the possibility of having some Facets that exclude *all* filter
> while
> : also having some Facets that take care of some of the set filters while
> : ignoring other filters.
> 
> FWIW: That webinar is nearly identical to the apachecon talk i gave on the 
> same topic, slides of which can be found here...
> 
> http://people.apache.org/~hossman/apachecon2010/facets/
> 
> This is the example i used on Slide #29...
> 
>   Same Facet, Different Exclusions
> 
>     * A key can be specified for a facet to change the name used to
>       identify it in the response.
>     * This allows you to have multiple instances of a facet, with
>        differnet exclusions.
> 
>             q = Hot Rod 
>            fq = {!df=colors tag=cx}purple green 
>   facet.field = {!key=all_colors ex=cx}colors 
>   facet.field = {!key=overlap_colors}colors
> 
> ...the point in that example is to treat a field (color) as two 
> differnt facets: one with exclusions and one without.
> 
> it sounds like what you want is differnet -- i *think* what you 
> are asking for is multiple exclusions for a single facet.  I didn't 
> mention that in my slides, but you can do that using a comma seperated 
> list of exclusions...
> 
>             q = Hot Rod 
>            fq = {!df=body tag=bc}purple
>            fq = {!df=interior tag=ic}green
>   facet.field = {!ex=bc,ic}model
> 
> -Hoss
> 


--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-Tags-and-Facets-tp2843130p2849115.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple Tags and Facets

Posted by Chris Hostetter <ho...@fucit.org>.
: I watched an online video with Chris Hostsetter from Lucidimagination. He
: showed the possibility of having some Facets that exclude *all* filter while
: also having some Facets that take care of some of the set filters while
: ignoring other filters.

FWIW: That webinar is nearly identical to the apachecon talk i gave on the 
same topic, slides of which can be found here...

http://people.apache.org/~hossman/apachecon2010/facets/

This is the example i used on Slide #29...

  Same Facet, Different Exclusions

    * A key can be specified for a facet to change the name used to
      identify it in the response.
    * This allows you to have multiple instances of a facet, with
       differnet exclusions.

            q = Hot Rod 
           fq = {!df=colors tag=cx}purple green 
  facet.field = {!key=all_colors ex=cx}colors 
  facet.field = {!key=overlap_colors}colors

...the point in that example is to treat a field (color) as two 
differnt facets: one with exclusions and one without.

it sounds like what you want is differnet -- i *think* what you 
are asking for is multiple exclusions for a single facet.  I didn't 
mention that in my slides, but you can do that using a comma seperated 
list of exclusions...

            q = Hot Rod 
           fq = {!df=body tag=bc}purple
           fq = {!df=interior tag=ic}green
  facet.field = {!ex=bc,ic}model

-Hoss