Exact word search in Solr

折月煮酒 提交于 2019-12-03 21:09:24

Using copyfield statements is the normal approach in Solr. Since stemming is the answer to exactly what you're asking, this is what I recommend you to use. You can set stored=false if you are worried about index size.

You might also use lemmatisation, which is the opposite of stemming - where you instead add a words all inflected forms. This is typically performed on the search query, expanding e.g., eat to eat, eats, eating etc.

The third alternative might be to use wildcard search, although I wouldn't encourage it. Not least since it bypasses all schema configured filters for the target field.

If you use text as the field type, then eat, eats, eaten and eating will all be stored as eat and a search for FieldName:eat will find all of them. If you change the field type to text-gen then the search for FieldName:eat will only find "eat", not eats, eaten or eating.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!