All,
There is a user tendency that users search with + instead of boolean operator AND. Is it that we need to explicitly convert + to AND before searching?
ex. I want search like
NBA + Results + MVP
instead of
NBA AND Results AND MVP..
All,
There is a user tendency that users search with + instead of boolean operator AND. Is it that we need to explicitly convert + to AND before searching?
ex. I want search like
NBA + Results + MVP
instead of
NBA AND Results AND MVP..
Hey,
a couple solutions here:
The query_string allows you to set a default operator, so you dont have to specify any thing to have an AND query. However if you want to use OR it still needs to be specified.
The simple_query_string only supports +
or -
instead if AND/OR
.
Last but not least, you could go with the match_query
and its default operator.
If you need to support AND/OR
plus +/-
you might need to build your own query parser.
Hope this helps.
--Alex
© 2020. All Rights Reserved - Elasticsearch
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.