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

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea1a0a-47944.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea1a0a-47944.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?