-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
Description
Elasticsearch version (bin/elasticsearch --version): 6.3.2
Plugins installed: []
JVM version (java -version): 1.8.0_181
OS version (uname -a if on a Unix-like system): Darwin Kernel Version 17.7.0
Description of the problem including expected versus actual behavior:
As I am supplying default_field=<field> parameter in the QUERY operand in the WHERE clause, it won't be deployed into query_string query.
Steps to reproduce:
- Create a new index with a single document as below:
PUT test/test/1
{
"tag_line": "You know for search",
"product": "Elasticsearch"
}
- Throw the following query to
_xpack/sql/translateendpoint.
POST _xpack/sql/translate
{
"query": "SELECT * FROM test WHERE QUERY('search', 'default_field=tag_line', 'default_operator=and')"
}
- Check if
default_fieldis not shown in the response whiledefault_operator=andis reflected.
{
"size": 1000,
"query": {
"query_string": {
"query": "search",
"fields": [],
"type": "best_fields",
"default_operator": "and",
"max_determinized_states": 10000,
"enable_position_increments": true,
"fuzziness": "AUTO",
"fuzzy_prefix_length": 0,
"fuzzy_max_expansions": 50,
"phrase_slop": 0,
"escape": false,
"auto_generate_synonyms_phrase_query": true,
"fuzzy_transpositions": true,
"boost": 1
}
},
"_source": {
"includes": [
"product",
"tag_line"
],
"excludes": []
},
"sort": [
{
"_doc": {
"order": "asc"
}
}
]
}
Provide logs (if relevant):