Solr advanced StopFilterFactory
I need advanced stop words filter in Solr.
We need stopwords to be stored in db and ability to change them by users (each user should have own stopwords). That's why I am thinking about sending stop words to solr from our app or connect to our db from solr and use updated stop words in custom StopFilterFactory.
Also each user will have own stopwords list which will be stored in mysql db "stopwords" table. (id, user_id, stopword).
We have next index structure. This index will store data for all users.
<field name="user_id" type="int" indexed="true" stored="true" required="true" multiValued="false" /> <field name="tag_name" type="text_general" indexed="true" stored="true" required="false" multiValued="false"/> ... <field name="tag_description" type="text_general" indexed="true" stored="true" required="false" multiValued="false"/>
I am not sure how to achive behaviour described above but I am thinking about writing own custom StopFilterFactory which will grab stopwords from db and use different stopwords for users while indexing their documents.
What you can suggest ? Is that possible ? Am I on right way ?
I don't think that querying a DB out of Solr to fetch stopword is a good idea.
I'd create a small cronjob or a service that queries the DB and pushes the stopwords into Solr using the above mentioned REST API.
Providing different stopwords for each user seems like an odd approach to me, as you need either a separate index or field for each user.