Elastic Search | How to use OR instead of AND?

Hi Daniel,

the easiest way I found was to change the default query parameters of the ElasticSearch query. This should however effect all full text queries. If that’s no trouble for you, you can change it with the following settings parameter:

Flowpack:
  ElasticSearch:
    ContentRepositoryAdaptor:
      driver:
        mapping:
          6.x:
            query:
              arguments:
                queryStringParameters:
                  default_operator: and

If you use driver version 6.x (7.x is an alias for 6.x).
You can show your current configuration using the command line, i.e.:

./flow configuration:show --path Flowpack.ElasticSearch.ContentRepositoryAdaptor.driver

If you do not want to set the default operator globally, you might be able to change it with the ElasticSearchQueryBuilder->appendAtPath() method.

Regards
Leif

1 Like