Solr Search Field Best Practices

孤人 提交于 2019-12-07 17:16:29

You can have another field for it and add string as the fieldType for the same and index it with same.

When you want to perform the exact match you can query on the above field.

And when you want to perform partial search ..you can query to the earlier field which is indexed by ngram.

OR.. Here is another way you can try.

You have defined the current field type using the ngram. In that while indexing you can define the ngram tokenizer and for the query you mention keywordTokenizer and lowercase filter factory only.

While indexing the text will be tokenized and while performing the query it will not.

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