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 SolrUser1543 <os...@gmail.com> on 2014/09/23 15:02:16 UTC

Combining several fields for facets.

Hi!
How can I create a facet combining 2 (or more) different fields, without
using copy field to union them?
For example if I have this documents:
Doc1 with the field X contains the value a and field Y contains the value b
Doc2 with the field X contains the value c and field Y contains the value a
Doc3 with the field X contains the value d and field Y contains the value d
I want to get this facet:
XY
a 2
b 1
c 1
d 1



--
View this message in context: http://lucene.472066.n3.nabble.com/Combining-several-fields-for-facets-tp4160679.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Combining several fields for facets.

Posted by SolrUser1543 <os...@gmail.com>.
I have many values in each field, I cant use facet query... (I dont know all
the values)



--
View this message in context: http://lucene.472066.n3.nabble.com/Combining-several-fields-for-facets-tp4160679p4161539.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Combining several fields for facets.

Posted by lboutros <bo...@gmail.com>.
How many different values do you have in your fields and do you know them ?

Faceting by query is not an option for you ?

Ludovic.



-----
Jouve
France.
--
View this message in context: http://lucene.472066.n3.nabble.com/Combining-several-fields-for-facets-tp4160679p4160866.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Combining several fields for facets.

Posted by SolrUser1543 <os...@gmail.com>.
Using a copy field will require reindeer of my data, I am looking for a
solution without reindex. 



--
View this message in context: http://lucene.472066.n3.nabble.com/Combining-several-fields-for-facets-tp4160679p4160858.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Combining several fields for facets.

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Why not copy them into a facet field. Space constraints?

If space is the concern, you need to remember that facets use indexed
value, so that copy target field has absolutely no reason to be
stored. And indexed values are stored only once per unique token, so
then you are only paying for posting table, which is what you need
anyway to do the counts.

Regards,
   Alex.

Personal: http://www.outerthoughts.com/ and @arafalov
Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
Solr popularizers community: https://www.linkedin.com/groups?gid=6713853


On 23 September 2014 09:02, SolrUser1543 <os...@gmail.com> wrote:
> Hi!
> How can I create a facet combining 2 (or more) different fields, without
> using copy field to union them?
> For example if I have this documents:
> Doc1 with the field X contains the value a and field Y contains the value b
> Doc2 with the field X contains the value c and field Y contains the value a
> Doc3 with the field X contains the value d and field Y contains the value d
> I want to get this facet:
> XY
> a 2
> b 1
> c 1
> d 1
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Combining-several-fields-for-facets-tp4160679.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Combining several fields for facets.

Posted by Erick Erickson <er...@gmail.com>.
If you used pivot facets you'd get all the information back, but you'd have
to combine the cells yourself.

Best,
Erick

On Tue, Sep 23, 2014 at 6:02 AM, SolrUser1543 <os...@gmail.com> wrote:

> Hi!
> How can I create a facet combining 2 (or more) different fields, without
> using copy field to union them?
> For example if I have this documents:
> Doc1 with the field X contains the value a and field Y contains the value b
> Doc2 with the field X contains the value c and field Y contains the value a
> Doc3 with the field X contains the value d and field Y contains the value d
> I want to get this facet:
> XY
> a 2
> b 1
> c 1
> d 1
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Combining-several-fields-for-facets-tp4160679.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>