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 Rihaed Tan <ta...@gmail.com> on 2009/08/27 21:27:55 UTC

Re: Return 2 fields per facet.. name and id, for example? / facet value search

Hi,

I have a similar requirement to Matthew (from his post 2 years ago). Is this
still the way to go in storing both the ID and name/value for facet values?
I'm planning to use id#name format if this is still the case and doing a
prefix query. I believe this is a common requirement so I'd appreciate if
any of you guys can share what's the best way to do it.

Also, I'm indexing the facet values for text search as well. Should the
field declaration below suffice the requirement?

<field name="category" type="text" indexed="true" stored="true"
required="true" multiValued="true"/>

Thanks,
R



> Re: Return 2 fields per facet.. name and id, for example?


> Matthew Runo

Fri, 07 Sep 2007 13:15:12 -0700


> Ahh... sneaky. I'll probably do the combined-name#id method.


> +--------------------------------------------------------+

| Matthew Runo

| Zappos Development

| [EMAIL PROTECTED]

| 702-943-7833

+--------------------------------------------------------+


>
> On Sep 7, 2007, at 12:38 PM, Yonik Seeley wrote:


>
>    On 9/7/07, Matthew Runo <[EMAIL PROTECTED]> wrote:


>        I've found something which is either already in SOLR, or should be

       (as I can see it being very helpful). I couldn't figure out how to do

       it though..


>        Lets say I'm trying to print out a page of products, and I want to

       provide a list of brands to filter by. It would be great if in my

       facets I could get this sort of xml...


>
>        <int name="adidas" id="1">45</int>


>        That way, I'd be able to know the brand id of adidas without having

       to run a second query somewhere for each facet to look it up.


>    If you can get the name from the id in your webapp, then index the id

   to begin with (instead of the name).

   <int name="1">45</int>


>     Or, if you need both the name and the id, index them both together,

   separated by a special character that you can strip out on the webapp

   side...


>    <int name="adidas#1">45</int>


>    -Yonik

Return 2 fields per facet.. name and id, for example? / facet value search

Posted by "R. Tan" <ta...@gmail.com>.
Sorry for the duplicate post, if ever, can anyone share their experience on
holding facet heading/value IDs in Solr?

On Fri, Aug 28, 2009 at 3:27 AM, Rihaed Tan <ta...@gmail.com> wrote:

> Hi,
>
> I have a similar requirement to Matthew (from his post 2 years ago). Is
> this still the way to go in storing both the ID and name/value for facet
> values? I'm planning to use id#name format if this is still the case and
> doing a prefix query. I believe this is a common requirement so I'd
> appreciate if any of you guys can share what's the best way to do it.
>
> Also, I'm indexing the facet values for text search as well. Should the
> field declaration below suffice the requirement?
>
> <field name="category" type="text" indexed="true" stored="true"
> required="true" multiValued="true"/>
>
> Thanks,
> R
>
>
>
>> Re: Return 2 fields per facet.. name and id, for example?
>
>
>> Matthew Runo
>
> Fri, 07 Sep 2007 13:15:12 -0700
>
>
>> Ahh... sneaky. I'll probably do the combined-name#id method.
>
>
>> +--------------------------------------------------------+
>
> | Matthew Runo
>
> | Zappos Development
>
> | [EMAIL PROTECTED]
>
> | 702-943-7833
>
> +--------------------------------------------------------+
>
>
>>
>> On Sep 7, 2007, at 12:38 PM, Yonik Seeley wrote:
>
>
>>
>>    On 9/7/07, Matthew Runo <[EMAIL PROTECTED]> wrote:
>
>
>>        I've found something which is either already in SOLR, or should be
>
>        (as I can see it being very helpful). I couldn't figure out how to
>> do
>
>        it though..
>
>
>>        Lets say I'm trying to print out a page of products, and I want to
>
>        provide a list of brands to filter by. It would be great if in my
>
>        facets I could get this sort of xml...
>
>
>>
>>        <int name="adidas" id="1">45</int>
>
>
>>        That way, I'd be able to know the brand id of adidas without having
>
>        to run a second query somewhere for each facet to look it up.
>
>
>>    If you can get the name from the id in your webapp, then index the id
>
>    to begin with (instead of the name).
>
>    <int name="1">45</int>
>
>
>>     Or, if you need both the name and the id, index them both together,
>
>    separated by a special character that you can strip out on the webapp
>
>    side...
>
>
>>    <int name="adidas#1">45</int>
>
>
>>    -Yonik
>
>

Re: Return 2 fields per facet.. name and id, for example? / facet value search

Posted by "R. Tan" <ta...@gmail.com>.
Thanks. I guess it will have to be the workaround then.

On Thu, Sep 3, 2009 at 3:34 PM, Shalin Shekhar Mangar <
shalinmangar@gmail.com> wrote:

> On Fri, Aug 28, 2009 at 12:57 AM, Rihaed Tan <ta...@gmail.com>
> wrote:
>
> > Hi,
> >
> > I have a similar requirement to Matthew (from his post 2 years ago). Is
> > this
> > still the way to go in storing both the ID and name/value for facet
> values?
> > I'm planning to use id#name format if this is still the case and doing a
> > prefix query. I believe this is a common requirement so I'd appreciate if
> > any of you guys can share what's the best way to do it.
> >
> > Also, I'm indexing the facet values for text search as well. Should the
> > field declaration below suffice the requirement?
> >
> > <field name="category" type="text" indexed="true" stored="true"
> > required="true" multiValued="true"/>
> >
>
> There have been talks of having a pair field type in Solr but there is no
> patch yet. So I guess the way proposed by Yonik is a good solution.
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

Re: Return 2 fields per facet.. name and id, for example? / facet value search

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Aug 28, 2009 at 12:57 AM, Rihaed Tan <ta...@gmail.com> wrote:

> Hi,
>
> I have a similar requirement to Matthew (from his post 2 years ago). Is
> this
> still the way to go in storing both the ID and name/value for facet values?
> I'm planning to use id#name format if this is still the case and doing a
> prefix query. I believe this is a common requirement so I'd appreciate if
> any of you guys can share what's the best way to do it.
>
> Also, I'm indexing the facet values for text search as well. Should the
> field declaration below suffice the requirement?
>
> <field name="category" type="text" indexed="true" stored="true"
> required="true" multiValued="true"/>
>

There have been talks of having a pair field type in Solr but there is no
patch yet. So I guess the way proposed by Yonik is a good solution.

-- 
Regards,
Shalin Shekhar Mangar.