Hi,

I cannot fully understand your point, but
you would like to apply KeepwordFilter to "title" field and switch keepword
files based on "categoryId" field value ?

I think that is essntially difficult because an Analyzer (including
Filters) cannot take into account another field values except for they are
analyzing.

If you have relatively few categories, you can handle such issue by using
multiple KeepWordFilters/Analyzers.
One filter/analyzer for categoryid=1, another filter/analyzer for
category=2, and so on...
Separate title fields correspond to each categories are also needed
(title_for_category1, title_for_category2, etc.)

If you need smarter way, this is just an idea however,
you might be able to have your own custom KeepwordFilter that holds
multiple keepwords set and switch them based on a parameter, not another
field value.


Regards,
Tomoko

2014-12-22 3:31 GMT+09:00 leostro <leo.orland...@gmail.com>:

> Hi all,
>
> I made some test and now I'm able to use keepwords for searching some
> common
> "brands" name in the docs I have in my index.
> I have docs with only two fields:
> - a title
> - a categoryId
> The tests I made right now were based on videogame related rows, so I have
> a
> keepwords.txt containing words like "nintendo", "playstation" and so on.
>
> Now I want to intruct solr to use a different keepword file depending on
> the
> categoryid value specified.
>
> So, for docs with categoryid=1 (videogame) I'd like to use keepwrods1.txt
> (the one with nintendo, playstation, etcetc) but id categoryid=2 (cars) I'd
> like to use keepwords2.txt (another file containg bmw, audi, etcetc)
>
> can someone help me?
> Regards
>
> Leo
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/set-keepword-file-to-be-used-based-on-a-field-value-tp4175474.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to