lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomoko Uchida <>
Subject Re: set keepword file to be used based on a field value
Date Mon, 22 Dec 2014 10:14:36 GMT
Hi Leo,

Yes, my image is similar to yours.
> If the value ends with "_CAT1" ==> use
> as keepword file "keepwords1.txt" and so on?

But my second option is not about configurations, but "customizing" Solr.

Utilizing customizability of Lucene/Solr, you can write your own
TokenFilter class.
Maybe your requirement is satisfied by subclassing

The custom filter class will take multiple keepword files, and build
multiple word sets (KeepwordFilter have only single word set),
and switch the word sets by field value's prefix (or other information.)
That is just my draft idea, there should be more sophisticated way...

If you are interested in (and familiar with Java programming of course,)
you would want to check out Solr source code from SVN and browse KeepwordFilter
/ KeepwordFilterFactory class for getting implementation image.


2014-12-22 17:10 GMT+09:00 leostro <>:

> Hi Tomoko,
> I understand you first reply and the first hint (one field for each
> categoryid).
> I thought this was a relatively "common" scenario.
> I'm interested in understanding the option you are talking about in the
> second reply.
> > you can tell "which keepwords set (file) shoud be used" to custom filter
> > by
> > adding special prefix (or something like) to the target field value.
> > but of course it makes indexing/querying process slightly complicated.
> Are you talking about adding a postfix (like _CAT1) at value of the field
> I'm going to analyze with keepwords? If the value ends with "_CAT1" ==> use
> as keepword file "keepwords1.txt" and so on?
> I can't understand how to reach this goal, have you seen some configuration
> examples?
> I didn't find anything :(
> Thanks
> Leo
> --
> View this message in context:
> Sent from the Solr - User mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message