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 Peter Karich <pe...@yahoo.de> on 2010/07/12 13:54:27 UTC

Using stored terms for faceting

Hi,

is it possible to use the stored terms of a field for a faceted search?

I mean, I don't want to get the term frequency per document as it is
shown here:
http://wiki.apache.org/solr/TermVectorComponentExampleOptions

I want to get the frequency of the term of my special search and show
only the 10 most frequent terms and all the nice things that I can do
for faceting.

At the moment I am calculating the terms for every document and index
them into a separate multivalued field where I can then easily apply
faceting.
But is there a better way?

Regards,
Peter.


Re: Using stored terms for faceting

Posted by Erik Hatcher <er...@gmail.com>.
This is simple faceting, doesn't even have to be a multi-valued  
field.  Just index your description field with the desired stop word  
removal and other analysis that you want done, and  
&facet.field=description

	Erik


On Jul 15, 2010, at 3:26 AM, Peter Karich wrote:

> Dear Hoss,
>
> I will try to clarify what I want to achieve :-)
>
> Assume I have the following three docs:
>
> id:1
> description: bmx bike 123
>
> id:2
> description: bmx bike 321
>
> id:3
> description: a mountain bike
>
> If I query against *:* I want to get the facets and its document  
> count ala:
> bike: 3
> bmx: 2
>
> I reached this with the following approach:
> I skip the noise words like 'a'. E.g. for doc 3 I will get the terms
> 'mountain' and 'bike'.
> Those two terms will then additionally indexed to a multivalued e.g.
> myfacet so that I can do faceting on that field.
>
> Is there a simpler approach?
>
> Regards,
> Peter.
>
>> : is it possible to use the stored terms of a field for a faceted  
>> search?
>>
>> No, the only thing stored fields can be used for is document centric
>> opterations (ie: once you have a small set of individual docIds,  
>> you can
>> access the stored fields to return to the user, or highlight, etc...)
>>
>> : I mean, I don't want to get the term frequency per document as it  
>> is
>> : shown here:
>> : http://wiki.apache.org/solr/TermVectorComponentExampleOptions
>> :
>> : I want to get the frequency of the term of my special search and  
>> show
>> : only the 10 most frequent terms and all the nice things that I  
>> can do
>> : for faceting.
>>
>> i honestly have no idea what you are saying you want -- can you  
>> provide
>> a concrete use case explaining what you mean?  describe some  
>> example data
>> and then explain what type of logic owuld happen and what type of  
>> result
>> you'd get back?
>>
>>
>>
>> -Hoss
>>
>>
>>
>
>
> -- 
> http://karussell.wordpress.com/
>


Re: Using stored terms for faceting

Posted by Peter Karich <pe...@yahoo.de>.
Dear Hoss,

I will try to clarify what I want to achieve :-)

Assume I have the following three docs:

id:1
description: bmx bike 123

id:2
description: bmx bike 321

id:3
description: a mountain bike

If I query against *:* I want to get the facets and its document count ala:
bike: 3
bmx: 2

I reached this with the following approach:
I skip the noise words like 'a'. E.g. for doc 3 I will get the terms
'mountain' and 'bike'.
Those two terms will then additionally indexed to a multivalued e.g.
myfacet so that I can do faceting on that field.

Is there a simpler approach?

Regards,
Peter.

> : is it possible to use the stored terms of a field for a faceted search?
>
> No, the only thing stored fields can be used for is document centric 
> opterations (ie: once you have a small set of individual docIds, you can 
> access the stored fields to return to the user, or highlight, etc...)
>
> : I mean, I don't want to get the term frequency per document as it is
> : shown here:
> : http://wiki.apache.org/solr/TermVectorComponentExampleOptions
> : 
> : I want to get the frequency of the term of my special search and show
> : only the 10 most frequent terms and all the nice things that I can do
> : for faceting.
>
> i honestly have no idea what you are saying you want -- can you provide 
> a concrete use case explaining what you mean?  describe some example data 
> and then explain what type of logic owuld happen and what type of result 
> you'd get back?
>
>
>
> -Hoss
>
>
>   


-- 
http://karussell.wordpress.com/


Re: Using stored terms for faceting

Posted by Chris Hostetter <ho...@fucit.org>.
: is it possible to use the stored terms of a field for a faceted search?

No, the only thing stored fields can be used for is document centric 
opterations (ie: once you have a small set of individual docIds, you can 
access the stored fields to return to the user, or highlight, etc...)

: I mean, I don't want to get the term frequency per document as it is
: shown here:
: http://wiki.apache.org/solr/TermVectorComponentExampleOptions
: 
: I want to get the frequency of the term of my special search and show
: only the 10 most frequent terms and all the nice things that I can do
: for faceting.

i honestly have no idea what you are saying you want -- can you provide 
a concrete use case explaining what you mean?  describe some example data 
and then explain what type of logic owuld happen and what type of result 
you'd get back?



-Hoss