-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Wrong result of "simple_query_search" with prefix query. #28204
Copy link
Copy link
Closed
Labels
:Search/SearchSearch-related issues that do not fall into other categoriesSearch-related issues that do not fall into other categories>bug
Description
Elasticsearch version
6.1.0
Plugins installed: []
JVM version (java -version):
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
OS version:
Ubuntu 17.10 with 4.13.0-21-generic
Description of the problem including expected versus actual behavior:
When index's mapping includes text and date properties, result of simple_query_search, which includes asterisk for prefix query,
returns no documents.
When there's no date properties on index's mappping, query works fine.
The same query works fine on 5.6 version.
Steps to reproduce:
- Create index "tests" with text and date properties.
curl -XPUT http://localhost:9200/tests -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
"mappings": {
"test": {
"properties": {
"date": {
"type": "date"
},
"name": {
"type": "text",
"fields": {
"raw": {
"type": "keyword"
}
}
}
}
}
}
}'
- Put some data
curl -XPUT http://localhost:9200/tests/test/1 -H 'Content-Type: application/json' -H 'Accept: application/json' -d '
{
"date": "2018-01-12",
"name": "test1"
}'
- Try to search with simple_query_search and asterisk.
curl -XPOST http://localhost:9200/tests/_search -H 'Content-Type: application/json' -H 'Accept: application/json' -d '
{
"query": {
"simple_query_string": {
"query": "te*"
}
}
}'
Received result: no documents found
Expected result: document with id 1 found
Provide logs (if relevant):
there's no errors on logs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Search/SearchSearch-related issues that do not fall into other categoriesSearch-related issues that do not fall into other categories>bug
Type
Fields
Give feedbackNo fields configured for issues without a type.