Today I will focus on fuzzy retrieval of Chinese names
Solr performs word segmentation on Chinese. If it is not a word, words may be lost, and then when querying the name, it will feel inaccurate.
Solr provides many query matching methods such as:
1. Use *: resume_keyword: *wang*
2. Use AND splicing to query keywords: *architecture* AND personName: *wang*
3.OR keyword: building OR personName: king
4. No: AND resume_keyword:(* NOT *Li*) The above are all concatenated, you can also filter with query.addFilterQuery(" per_name:(*Li* )");
5. Name matching method: When doing a search before, the name was set to a participle, and then the result of the participle was not very accurate, for example: ABC, it may be divided into AB and then there is no C, so you can't find ABC when you query .
The previous participle is IK
<fieldType name="text_ik" class="solr.TextField">
<analyzer type="index" class="org.wltea.analyzer.lucene.IKAnalyzer"/>
<analyzer type="query" class="org.wltea.analyzer.lucene.IKAnalyzer"/>
</fieldType>
The above problem occurred, and then we studied the attribute type in schema.xml. We used text_ik before and changed it to text_general,这样它就可以把ABC分成了A,B,C 通过一个其中的一个字或者ABC都可以检索了,就不用上面的模糊匹配了,就算匹配了,也不太准,可能把自己需要的那一行数据放到了第七八行,而不是第一行。如果按照上面修改,就可以把想要的数据放到第一位了
期间看到网上有介绍,把你传入的字进行分词,然后把分的词当条件传进去,这种思路可行,我觉得比较符合检索文章的关键字
I'm still exploring solr. There are many things in schema.xml to learn. If you understand this, I think you basically understand the core things of solr.