Now when I perform a search to match some date, I am not getting the
expected result.
Consider query like this
{
"query": {
"filtered": {
"query": {
"query_string": {
"query": "exp_date:[2013-03-1 TO 2013-03-5]"
}
}
}
},
"fields": [
"price",
"quan_available",
"product_name",
"product_description",
"exp_date",
"man_date"
],
"from": 0,
"size": 50,
"sort": {
"_score": {
"order": "asc"
}
},
"explain": true
}
Gives me expected result, that is all the documents which matches this date
range, but when I remove the field Name exp_date from the query string, I
am getting no result at all.
The following query results zero result.
{ "query": { "filtered": { "query": { "query_string": { "query":
"[2013-03-1 TO 2013-03-5]" } } } }, "fields": [ "price", "quan_available",
"product_name", "product_description", "exp_date", "man_date" ], "from": 0,
"size": 50, "sort": { "_score": { "order": "asc" } }, "explain": true }
Can anybody suggest solution to this problem? What am doing wrong?
Thansk in advance.
On Friday, May 2, 2014 3:13:30 PM UTC+5:30, Hemant wrote:
Hello,
I have indexed some data, with default mapping -
{
"inventory": {
"products": {
"properties": {
"exp_date": {
"type": "date",
"format": "dateOptionalTime"
},
"man_date": {
"type": "date",
"format": "dateOptionalTime"
},
"price": {
"type": "long"
},
"product_description": {
"type": "string"
},
"product_name": {
"type": "string"
},
"quan_available": {
"type": "long"
}
}
}
}
}
Now when I perform a search to match some date, I am not getting the
expected result.
Consider query like this
{
"query": {
"filtered": {
"query": {
"query_string": {
"query": "exp_date:[2013-03-1 TO 2013-03-5]"
}
}
}
},
"fields": [
"price",
"quan_available",
"product_name",
"product_description",
"exp_date",
"man_date"
],
"from": 0,
"size": 50,
"sort": {
"_score": {
"order": "asc"
}
},
"explain": true
}
Gives me expected result, that is all the documents which matches this
date range, but when I remove the field Name exp_date from the query
string, I am getting no result at all.
The following query results zero result.
{ "query": { "filtered": { "query": { "query_string": { "query":
"[2013-03-1 TO 2013-03-5]" } } } }, "fields": [ "price", "quan_available",
"product_name", "product_description", "exp_date", "man_date" ], "from": 0,
"size": 50, "sort": { "_score": { "order": "asc" } }, "explain": true }
Can anybody suggest solution to this problem? What am doing wrong?
Thansk in advance.
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.