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 Daniel Brügge <da...@googlemail.com> on 2012/03/06 11:33:19 UTC

Filter facet_fields with Solr similar to stopwords

Hi,

I am using a solr.StopFilterFactory in a query filter for a text_general
field (here: content). It works fine, when I query the field for the
stopword, then I am getting no results.

But I am also doing a facet.field=content call to get the words which are
used in the text. What I am trying to achieve is, to also filter the
stopwords from the facet_fields, but it's not working. It would only work
if the stopwords are also used during the indexing of the text_general
field, right?

The problem here is, that it's too much data to re-index every time I add a
new stopword.

My current solution is to 'filter' with code after retrieving the
facet_fields from Solr. But is there a Solr-based way to do this niftier?

Thanks & regards

Daniel

Re: Filter facet_fields with Solr similar to stopwords

Posted by Chris Hostetter <ho...@fucit.org>.
: I am using a solr.StopFilterFactory in a query filter for a text_general
: field (here: content). It works fine, when I query the field for the
: stopword, then I am getting no results.
	...
: used in the text. What I am trying to achieve is, to also filter the
: stopwords from the facet_fields, but it's not working. It would only work
: if the stopwords are also used during the indexing of the text_general
: field, right?
	...
: My current solution is to 'filter' with code after retrieving the
: facet_fields from Solr. But is there a Solr-based way to do this niftier?

Not really. field.facet works based on the terms in the index -- if the 
term is in the index, and it's in the documents matching your query, you 
are going to get counts back for it.




-Hoss

Re: Filter facet_fields with Solr similar to stopwords

Posted by Daniel Brügge <da...@googlemail.com>.
OK, I've found this posting from 2009:

http://lucene.472066.n3.nabble.com/excluding-certain-terms-from-facet-counts-when-faceting-based-on-indexed-terms-of-a-field-td501104.html

But this

facet.field={!terms=WORDTOEXCLUDE}content

approach also only shows me the counting of the word I want to exclude.

On Tue, Mar 6, 2012 at 11:33 AM, Daniel Brügge <
daniel.bruegge@googlemail.com> wrote:

> Hi,
>
> I am using a solr.StopFilterFactory in a query filter for a text_general
> field (here: content). It works fine, when I query the field for the
> stopword, then I am getting no results.
>
> But I am also doing a facet.field=content call to get the words which are
> used in the text. What I am trying to achieve is, to also filter the
> stopwords from the facet_fields, but it's not working. It would only work
> if the stopwords are also used during the indexing of the text_general
> field, right?
>
> The problem here is, that it's too much data to re-index every time I add
> a new stopword.
>
> My current solution is to 'filter' with code after retrieving the
> facet_fields from Solr. But is there a Solr-based way to do this niftier?
>
> Thanks & regards
>
> Daniel
>