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 Marc Sturlese <ma...@gmail.com> on 2008/12/23 13:55:43 UTC
"static facet field"
Hey there,
I missed couple of things these days about faceting:
First one was that I wanted to do date facet with more than a date start,
end and gap... I sorted it modifing the function getFacetDateCounts() and
adding the parameters in the xml this way:
<str name="facet.date">date</str>
<str name="facet.date.start">NOW/DAY-1YEAR</str>
<str name="facet.date.end">NOW/DAY</str>
<str name="facet.date.gap">+1YEAR</str>
<str name="facet.date.start">NOW/DAY-6MONTH</str>
<str name="facet.date.end">NOW/DAY</str>
<str name="facet.date.gap">+6MONTH</str>
<str name="facet.date.start">NOW/DAY-3MONTH</str>
<str name="facet.date.end">NOW/DAY</str>
<str name="facet.date.gap">+3MONTH</str>
It will show me the number of docs from the last year, last 6 month and last
3 month. It's working quite well and doesn't descreases the search speed.
My other goal is to do something I have called static facets by field. I
would like to specify the terms to facet in the sorlconfig. Lets supose I
have a field called animals. I want to do facet fields with the tokens
cat,doc,monkey and I wan to pass these words by solr config.xml
Is this done or should I do a hack? In that case... any advice?
Thanks in advance
--
View this message in context: http://www.nabble.com/%22static-facet-field%22-tp21143977p21143977.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: "static facet field"
Posted by Marc Sturlese <ma...@gmail.com>.
Exactly!
I thought facet query just worked for range numbers. I complicating myself a
lot...
Thank you
Erik Hatcher wrote:
>
>
> On Dec 23, 2008, at 7:55 AM, Marc Sturlese wrote:
>> My other goal is to do something I have called static facets by
>> field. I
>> would like to specify the terms to facet in the sorlconfig. Lets
>> supose I
>> have a field called animals. I want to do facet fields with the tokens
>> cat,doc,monkey and I wan to pass these words by solr config.xml
>>
>> Is this done or should I do a hack? In that case... any advice?
>
> You mean like
> &facet
> .query
> =animals:cat&facet.query=animals:dog&facet.query=animals:monkey ??
>
> Erik
>
>
>
--
View this message in context: http://www.nabble.com/%22static-facet-field%22-tp21143977p21145435.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: "static facet field"
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Dec 23, 2008, at 7:55 AM, Marc Sturlese wrote:
> My other goal is to do something I have called static facets by
> field. I
> would like to specify the terms to facet in the sorlconfig. Lets
> supose I
> have a field called animals. I want to do facet fields with the tokens
> cat,doc,monkey and I wan to pass these words by solr config.xml
>
> Is this done or should I do a hack? In that case... any advice?
You mean like
&facet
.query
=animals:cat&facet.query=animals:dog&facet.query=animals:monkey ??
Erik