Is there a more efficient way to query * text*, with wildcards in lucene? In this way, when there is too much data, it will be very slow.

I am now in Lucene, indexing a Document, such as:

Document document = new Document();
document.add(new StringField("text", "123456789", Field.Store.YES));
writer.addDocument(document);

I can query this document:

using the following wildcard query
Query query = new WildcardQuery(new Term("text", "*456*"));

however, as soon as there is too much data, it will be very slow. I wonder if there is a more efficient way to achieve this query requirement.

Oct.09,2021

full text search with lucene

Menu