Configure SOLR to find documents if the plural is used in the document, and the singular in the search text?

后端 未结 2 1978
不思量自难忘°
不思量自难忘° 2020-12-31 14:56

I am using solr, set up at localhost:8983 I am basically using the out of the box example. I have entered one document with a name \"Car\", and another with a name \"Cars\".

相关标签:
2条回答
  • 2020-12-31 15:41

    It is possible, just add porter filter at the end (after LowerCaseFilterFactory):

    <filter class="solr.SnowballPorterFilterFactory" language="English" />
    

    Read more:

    1. Snowball docs with example of use in analyser
    2. Solr LanguageAnalysis
    3. The English (Porter2) stemming algorithm

    If there is no special need, I would not divide analyser to index and query time. Your query time analyser looks perfectly good to use it in both cases.

    0 讨论(0)
  • 2020-12-31 15:42

    I found that changing from text_general to text_en in the shema.xml fields took care of this plurality problem

    0 讨论(0)
提交回复
热议问题