I hope this helps you . You want to build a boolean query where one part targets the firstname and the other the lastname. Something like this: Query luceneQuery = queryBuilder .bool() .should( ) .should( ) .createQuery();
will help you Lucene does not support wildcards in phrase queries. There are strategies on how you represent the data in your index that can allow you to accomplish it. You are treating your query as a keyword, it appears. In that case, you should really be treating the field as a keyword when indexing, as well, in which case you would be able to search the whole title as a single term. Phrases and keywords with spaces are very different things to Lucene, and you can't use them interchangeably.
Can I perform a query that returns data only for columns that match a wildcard?
I hope this helps you . Using prepared statements, you can build the query dynamically from INFORMATION_SCHEMA, then execute it:
SET @QUERY=CONCAT_WS(" ",
(SELECT GROUP_CONCAT(`COLUMN_NAME`) FROM `INFORMATION_SCHEMA`.`COLUMNS`
WHERE `TABLE_NAME` = "MyTable" AND `COLUMN_NAME` LIKE "BLOCK_A_%"),
PREPARE myQuery FROM @QUERY;
How to add wildcard query in Hibernate Search 3.1.1GA