通配符*只能用在词尾,如user*
.
The wildcard * can only be used at the end of a word, like user*
.
我想用 %user%
之类的查询,怎么做?
I want to query with a like %user%
, how to do that?
Lucene提供了ReverseStringFilter 允许像 *user 一样进行前导通配符搜索.它通过以相反的顺序索引所有术语来工作.
Lucene provides the ReverseStringFilter that allows to do leading wildcard search like *user. It works by indexing all terms in reverse order.
但我认为没有办法做类似于 'LIKE %user%' 的事情.
But I think there is no way to do something similar to 'LIKE %user%'.
这篇关于如何使用“like"查询 lucene操作员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!