Substring in filter query (fq)...

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Substring in filter query (fq)...

escher2k
I have a requirement where I have to search a product catalog and filter on a substring. I am
not sure if this is supported. Any help is appreciated. I have included the use case below.

Example: 
Root cat -> Digital -> Watch -> "Timex Essentials"
Root cat -> Men -> Accessories -> "Timex Essentials"
In the example above, we essentially have a product that is a part of two separate hierarchies.
In the use case that I have, I want to index the following information -

Name                     Category
-----------------  -----------------------------------------
Timex Essentials    Root cat, Digital, Watch, Men, Accessories

The query I want to execute is-
q=Timex                        (search name field)
fq=category:%Digital% (filter on category field)

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Substring in filter query (fq)...

Otis Gospodnetic-2

Hi,

It looks like you don't have about the hierarchy when doing your queries.  That makes things simpler, and you already have the answer, more or less:

?q=name:Timex&fq=category:Digital

Otis --
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----

> From: escher2k <[hidden email]>
> To: [hidden email]
> Sent: Tuesday, May 26, 2009 8:43:08 PM
> Subject: Substring in filter query (fq)...
>
>
> I have a requirement where I have to search a product catalog and filter on a
> substring. I am
> not sure if this is supported. Any help is appreciated. I have included the
> use case below.
>
> Example:
> Root cat -> Digital -> Watch -> "Timex Essentials"
> Root cat -> Men -> Accessories -> "Timex Essentials"
> In the example above, we essentially have a product that is a part of two
> separate hierarchies.
> In the use case that I have, I want to index the following information -
>
> Name                    Category
> -----------------  -----------------------------------------
> Timex Essentials    Root cat, Digital, Watch, Men, Accessories
>
> The query I want to execute is-
> q=Timex                        (search name field)
> fq=category:%Digital% (filter on category field)
>
> Thanks.
> --
> View this message in context:
> http://www.nabble.com/Substring-in-filter-query-%28fq%29...-tp23734022p23734022.html
> Sent from the Solr - User mailing list archive at Nabble.com.