java - Perform Lucene wildcard search -
how lucene support wild card searches?
i want search words starting ox searching words ox*
returning unexpected results anti-oxide
- don't want result.
according lucene faq query ox*
should match terms begin ox.
because standardtokenizer
considers hyphen delimiter, word anti-oxide
split 2 words - anti
, oxide
, hence match anti-oxide
when search ox*
.
you have 2 options change behavior:
- override default tokenizer , write own suit needs
- ugly pre-processing of text replace/remove such delimiters. may not ideal solution
Comments
Post a Comment