简体   繁体   中英

about search using Lucene?

I am using Lucene based search engine.

For example, I have a field like "name": "blue sky"

I can search use blue or sky, but not blu. I think blu is part of blue, why I cannot search the blu?

You need to use wildcard ( blu* ) or fuzzy searches ( blu~ ). More information available here .

Or, you can define a special mapping to cover that need. For example, in elasticsearch, you can define a edgeNgram analyzer for the field.

WildcardQueries searches are slower than termQueries. You can use also PrefixQuery .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM