Adam Lee
Adam Lee

Reputation: 25778

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?

Upvotes: 0

Views: 63

Answers (2)

dadoonet
dadoonet

Reputation: 14512

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.

Upvotes: 1

mindas
mindas

Reputation: 26733

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

Upvotes: 1

Related Questions