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 Licinio Fernández Maurelo <li...@gmail.com> on 2009/07/23 19:09:13 UTC

facet.prefix question

i'm trying to do some filtering in the count list retrieved by solr when
doing a faceting query ,

i'm wondering how can i use facet.prefix to gem something like this:

Query

........facet.field=foo&facet.prefix=A OR B

Response

<lst name="facet_fields">
-
<lst name="foo">
<int name="A********">12560</int>
<int name="A*********">5440</int>
<int name="B**********">2357</int>
.
.
.
</lst>



How can i achieve such this behaviour?

Best Regards

-- 
Lici

Re: facet.prefix question

Posted by Koji Sekiguchi <ko...@r.email.ne.jp>.
Licinio Fernández Maurelo wrote:
> i'm trying to do some filtering in the count list retrieved by solr when
> doing a faceting query ,
>
> i'm wondering how can i use facet.prefix to gem something like this:
>
> Query
>
> ........facet.field=foo&facet.prefix=A OR B
>
> Response
>
> <lst name="facet_fields">
> -
> <lst name="foo">
> <int name="A********">12560</int>
> <int name="A*********">5440</int>
> <int name="B**********">2357</int>
> .
> .
> .
> </lst>
>
>
>
> How can i achieve such this behaviour?
>
> Best Regards
>
>   

You cannot set a query for facet.prefix parameter. facet.prefix should
be a prefix *string* of terms in the index, and you can set it at a time.
So I think you need to send two requests to get what you want:

...&facet.field=foo&facet.prefix=A
...&facet.field=foo&facet.prefix=B


Koji