I'm trying to match multiple words in Lucene as I could do in MySQL.
It's harder than I thought:
written in PHP: my query for perfect match is:
$words = explode($words, " ");
(text:(' . implode(" ", $words) . ')
but if text is "a bunch of words I wrote", it won't match until I have written everything
Does exist any way to force Lucene to behave exactly like MySQL's like "%a bunc%" and retrieve the hole phrase?
Thanks in advance
EDIT:
I'm not using Lucene directly, I use Solr as a REST service. So I'm looking for the "plain grammar" to solve this problem like: select?q=: and the query is : ( select all ) if I have many words in the text field, as told before, I don't find any way to consider them as a unique word. If it were a unique word, I could do "text:(beginningOfW*)" and it would find it, If it is a multiple words, If I write "text:(beginning Of W*)" it will find only words beginning with W, and ignore the other words.
Yes, Lucene is full text search engine API. I think you are looking for WildCardQuery: