Created
December 6, 2015 14:07
-
-
Save kharazi/ab0cb0b8fd87c5ec2935 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XDELETE "http://localhost:9200/test_index" | |
echo | |
echo | |
curl -XPUT "http://localhost:9200/test_index" -d' | |
{ | |
"mappings": { | |
"doc": { | |
"properties": { | |
"publication_date": { | |
"type": "date", | |
"format": "dateOptionalTime" | |
} | |
} | |
} | |
} | |
}' | |
echo | |
echo | |
curl -XPOST "http://localhost:9200/test_index/doc/_bulk" -d' | |
{"index":{"_id":1}} | |
{"fetched_date":"2015-06-08T06:23:15.664000","publication_date":"2015-06-08T06:12:04.826000","source":"5402af95608395df3fe474dd"} | |
{"index":{"_id":2}} | |
{"fetched_date": "2015-02-03T10:52:58.575000", "publication_date": "2015-02-03T10:23:54", "dup": true} | |
' | |
curl -XPOST "http://localhost:9200/test_index/_search" | |
echo | |
echo | |
curl -XPOST "http://localhost:9200/test_index/_search" -d' | |
{ | |
"query": { | |
"filtered": { | |
"query": { | |
"match_all": {} | |
}, | |
"filter": { | |
"range": { | |
"publication_date": { | |
"lte": "2018-12-01", | |
"gte": "2014-12-02" | |
} | |
} | |
} | |
} | |
} | |
}' | |
echo | |
echo | |
curl -XPOST "http://localhost:9200/test_index/_search" -d' | |
{ | |
"query": { | |
"filtered": { | |
"query": { | |
"match_all": {} | |
}, | |
"filter": { | |
"range": { | |
"publication_date": { | |
"lte": "2015-05-01", | |
"gte": "2014-12-02" | |
} | |
} | |
} | |
} | |
} | |
}' | |
echo | |
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"acknowledged":true} | |
{"acknowledged":true} | |
{"_index":"test_index","_type":"doc","_id":"AVF3miQZXzFtuVrruvYz","_version":1,"created":true}{"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}} | |
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}} | |
{"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}} |
sloanahrens
commented
Dec 6, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment