Lucene.net 搜索和下划线
下划线“_”的作用类似于 AND,不是吗?
当搜索任何一个时,
test_12 , 12_test , 12 AND test , test AND 12
我都会得到同样的结果。
但为什么通配符会出现问题呢?
mytest* AND abc_IN_CRM_C --> finds results!
abc_IN_CRM_C_mytest* --> no results!
abc_IN_CRM_C AND mytest* --> results ?!
我做错了什么?
The Underscore '_' works like an AND, doesn't it?
When searching for any of
test_12 , 12_test , 12 AND test , test AND 12
I get the same hit.
But why is there a problem with the wildcard?
mytest* AND abc_IN_CRM_C --> finds results!
abc_IN_CRM_C_mytest* --> no results!
abc_IN_CRM_C AND mytest* --> results ?!
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用的是 StandardAnalyzer,则文本将按下划线分割。这就是为什么您会得到与使用“AND”相同的结果。
另请参阅 Lucene 搜索和下划线
If you are using the StandardAnalyzer, then the text is split on underscores. That's why you get the same results as using "AND".
Also see Lucene search and underscores