profanity filteration in solr

2019-07-31 11:36发布

问题:

I am servering some webdata to my site using apache solr 4.10.3. I have to block profanity.

How do I block profanity in search?

I have some confusion about this filter deployment also.

Should I apply filter for profanity at document indexing time or document search time?

回答1:

You have 2 possibilities :

  1. Don't send the document to Solr in the first place (filter it in your code)
  2. Implement a custom UpdateRequestProcessor : https://cwiki.apache.org/confluence/display/solr/Update+Request+Processors


标签: solr lucene