Elasticsearch URI based query with AND operator

For URI search in ElasticSearch, you can use either the AND operator profiletype:student AND username:s, as you say but without quotes:

  _search?q=profiletype:student AND username:s*

You can also set the default operator to AND

  _search?q=profiletype:student username:s*&default_operator=AND

Or you can use the + operator for terms that must be present, i.e. one would use +profiletype:student +username:s as query string. This doesn’t work without URL encoding, though. In URL encoding + is %2Band space is %20, therefore the alternative would be

  _search?q=%2Bprofiletype:student%20%2Busername:s*

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)