它是2字有可能在lucence [英] Is it 2 character search possible in lucence

查看:126
本文介绍了它是2字有可能在lucence的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于lucence搜索问题 是否有可能用从文件搜索2字符lucence搜索

Hi i have a question about lucence search Is it possible to search a 2 character from file using lucence search

有关前。如果有喜欢的名字KARTHIK测试是有可能搜索か或lucenceTE。如果是的话请提供一个code片。

For ex. if there are names like "karthik test" is it possible to search for "ka" or "te" in lucence. If so kindly provide a code piece..

推荐答案

是的,这是可能使用的通配符的。

Yes, this is possible using wildcards.

订阅您的<一个href="http://lucene.apache.org/core/4_0_0/queryparser/org/apache/lucene/queryparser/classic/QueryParser.html"相对=nofollow> QueryParser的与 TE * ,它会生成一个 TE preFIX任何后缀。

Feed your QueryParser with te*, and it will generate a query that starts for a te prefix with any suffix.

这篇关于它是2字有可能在lucence的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆