I use elasticsearch search engine, and when I run the code below, the returned results do not meet the criteria of the range (I get items with a published date below the desired limit):
#!/bin/bash curl -X GET 'http://localhost:9200/newsidx/news/_search?pretty' -d '{ "fields": [ "art_text", "title", "published", "category" ], "query": { "bool": { "should": [ { "fuzzy": {"art_text": {"boost": 89, "value": "google" }} }, { "fuzzy": {"art_text": {"boost": 75, "value": "twitter" }} } ], "minimum_number_should_match": 1 } }, "filter" : { "range" : { "published" : { "from" : "2013-04-12 00:00:00" } } } } '
I also tried to make the range clause mandatory, inside the bool query, but the results were the same.
Edit: I use elasticsearch to search in mongodb across the river fin. This is the script I ran to look for mongodb db with ES:
#!/bin/bash curl -X PUT localhost:9200/_river/mongodb/_meta -d '{ "type":"mongodb", "mongodb": { "db": "newsful", "collection": "news" }, "index": { "name": "newsidx", "type": "news" } }'
In addition, I did not create other indexes.
Edit 2:
Es display view:
http://localhost:9200/newsidx/news/_mapping published: { type: "string" }
Rod0n source share