How to find a match within one term using Lucene

I use the Lucene search engine, but it seems to find matches that are found at the beginning of the terms.

For example: A search for “one” will match “onematch” or “one day time,” but not “loneranger.”

Lucene doc says that it does not support wildcards at the beginning of the search string, so I'm not sure Lucene even searches for intertemporal matches or can only match documents starting with a search query.

Is this a problem with how I created my index, how I build my search query, or just a Lucene restriction?

+3
source share
3 answers

Lucene , - , , , . , , Lucene ( ), , ( ).

0

" = WildcardQuery ( (" "," * * "));"

- , .

"one" should be enclosed with an asterisk. I set a space in the request after *, but there should be no space. without a space * is not displayed, so I added a star.

0
source

Source: https://habr.com/ru/post/1711927/


All Articles