I have a query that I've got working nicely but returns no data if I use a wildcard.
Do I have to enable wildcards somewhere or should I be using the wildcard query instead?
If I need to use the wildcard query then I need to start detecting wildcards in the user's search phrase and then alter the query - I don't like the idea of that so any help appreciated...?
The match and multi_match queries do not support wildcards. In general you should avoid using wildcards in your queries as they are not efficient. A more efficient solution would be to index the fields using ngrams.
If you can't use ngrams and need to use a wildcard query this will do what you want:
OK, thanks - that's a shame as I was wanting to allow "power-users" the ability to use wildcards and phrase searching with double-quotes etc... a la Google.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.