Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- curl 'http://localhost:9200/?pretty'
- {
- "name" : "John Jameson",
- "cluster_name" : "elasticsearch_artem.bikov",
- "version" : {
- "number" : "2.3.4",
- "build_hash" : "e455fd0c13dceca8dbbdbb1665d068ae55dabe3f",
- "build_timestamp" : "2016-06-30T11:24:31Z",
- "build_snapshot" : false,
- "lucene_version" : "5.5.0"
- },
- "tagline" : "You Know, for Search"
- }
- ➜ ~ curl 'http://localhost:9200/?pretty'
- {
- "name" : "John Jameson",
- "cluster_name" : "elasticsearch_artem.bikov",
- "version" : {
- "number" : "2.3.4",
- "build_hash" : "e455fd0c13dceca8dbbdbb1665d068ae55dabe3f",
- "build_timestamp" : "2016-06-30T11:24:31Z",
- "build_snapshot" : false,
- "lucene_version" : "5.5.0"
- },
- "tagline" : "You Know, for Search"
- }
- ➜ ~ curl -XPUT "http://localhost:9200/releadgion/user_action/1?pretty" -d'{ "type": "registration", "attributes": { "email": "test@test.ru", "source": "direct" } }'
- {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "1",
- "_version" : 1,
- "_shards" : {
- "total" : 2,
- "successful" : 1,
- "failed" : 0
- },
- "created" : true
- }
- ➜ ~ curl -XPUT "http://localhost:9200/releadgion/user_action/2?pretty" -d'{ "type": "campaign_created", "attributes": { "email": "test@test.ru", "campaign_id": 12, "platform": "my_target" } }'
- {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "2",
- "_version" : 1,
- "_shards" : {
- "total" : 2,
- "successful" : 1,
- "failed" : 0
- },
- "created" : true
- }
- ➜ ~ curl -XPUT "http://localhost:9200/releadgion/user_action/3?pretty" -d'{ "type": "advert_stopped", "attributes": { "email": "test@test.ru", "campaign_id": 12, "advert_id": 44 } }'
- {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "3",
- "_version" : 1,
- "_shards" : {
- "total" : 2,
- "successful" : 1,
- "failed" : 0
- },
- "created" : true
- }
- ➜ ~ curl -XPUT "http://localhost:9200/releadgion/user_action/1?pretty" -d'{ "type": "registration", "email": "test@test.ru", "source": "direct" }'
- {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "1",
- "_version" : 2,
- "_shards" : {
- "total" : 2,
- "successful" : 1,
- "failed" : 0
- },
- "created" : false
- }
- ➜ ~ curl -XPUT "http://localhost:9200/releadgion/user_action/1?pretty" -d'{ "type": "registration", "email": "test@test.ru", "source": "direct" }'
- {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "1",
- "_version" : 3,
- "_shards" : {
- "total" : 2,
- "successful" : 1,
- "failed" : 0
- },
- "created" : false
- }
- ➜ ~ curl -XPATCH "http://localhost:9200/releadgion/user_action/1?pretty" -d'{ "type": "registration", "email": "test@test.ru", "source": "direct" }'
- {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "1",
- "_version" : 3,
- "found" : true,
- "_source" : {
- "type" : "registration",
- "email" : "test@test.ru",
- "source" : "direct"
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/1?pretty"
- {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "1",
- "_version" : 3,
- "found" : true,
- "_source" : {
- "type" : "registration",
- "email" : "test@test.ru",
- "source" : "direct"
- }
- }
- ➜ ~ curl -XPATCH "http://localhost:9200/releadgion/user_action/2?pretty" -d'{ "type": "campaign_created", "email": "test@test.ru", "campaign_id": 12, "platform": "my_target" }'
- {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "2",
- "_version" : 1,
- "found" : true,
- "_source" : {
- "type" : "campaign_created",
- "attributes" : {
- "email" : "test@test.ru",
- "campaign_id" : 12,
- "platform" : "my_target"
- }
- }
- }
- ➜ ~ curl -XPATCH "http://localhost:9200/releadgion/user_action/3?pretty" -d'{ "type": "advert_stopped", "email": "test@test.ru", "campaign_id": 12, "advert_id": 44 }'
- {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "3",
- "_version" : 1,
- "found" : true,
- "_source" : {
- "type" : "advert_stopped",
- "attributes" : {
- "email" : "test@test.ru",
- "campaign_id" : 12,
- "advert_id" : 44
- }
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty" -d'
- quote> {
- quote> "filter": {
- quote> "term": {
- quote> "email": "test@test.ru"
- quote> }
- quote> }
- quote> }'
- {
- "took" : 197,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 0,
- "max_score" : null,
- "hits" : [ ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/1?pretty"
- {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "1",
- "_version" : 3,
- "found" : true,
- "_source" : {
- "type" : "registration",
- "email" : "test@test.ru",
- "source" : "direct"
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty" -d'
- {
- "filter": {
- "term": {
- "email": "test@test.ru"
- }
- }
- }'
- {
- "took" : 39,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 0,
- "max_score" : null,
- "hits" : [ ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty" -d'
- quote> {
- quote> "_source": [
- quote> "type",
- quote> "email"
- quote> ],
- quote> "filter": {
- quote> "term": {
- quote> "email": "test@test.ru"
- quote> }
- quote> }
- quote> }'
- {
- "took" : 35,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 0,
- "max_score" : null,
- "hits" : [ ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty" -d'
- quote> {
- quote> "query": {
- quote> "term": {
- quote> "email": "test@test.ru"
- quote> }
- quote> }
- quote> }'
- {
- "took" : 247,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 0,
- "max_score" : null,
- "hits" : [ ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/3?pretty
- dquote> ]
- dquote>
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/3?pretty
- dquote> "
- curl: (3) Illegal characters found in URL
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/3?pretty"
- {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "3",
- "_version" : 1,
- "found" : true,
- "_source" : {
- "type" : "advert_stopped",
- "attributes" : {
- "email" : "test@test.ru",
- "campaign_id" : 12,
- "advert_id" : 44
- }
- }
- }
- ➜ ~ curl -XPUT "http://localhost:9200/releadgion/user_action/1?pretty" -d'{ "type": "registration", "email": "test@test.ru", "source": "direct" }'
- {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "1",
- "_version" : 4,
- "_shards" : {
- "total" : 2,
- "successful" : 1,
- "failed" : 0
- },
- "created" : false
- }
- ➜ ~ curl -XPUT "http://localhost:9200/releadgion/user_action/2?pretty" -d'{ "type": "campaign_created", "email": "test@test.ru", "campaign_id": 12, "platform": "my_target" }'
- {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "2",
- "_version" : 2,
- "_shards" : {
- "total" : 2,
- "successful" : 1,
- "failed" : 0
- },
- "created" : false
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/2?pretty"
- {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "2",
- "_version" : 2,
- "found" : true,
- "_source" : {
- "type" : "campaign_created",
- "email" : "test@test.ru",
- "campaign_id" : 12,
- "platform" : "my_target"
- }
- }
- ➜ ~ curl -XPUT "http://localhost:9200/releadgion/user_action/3?pretty" -d'{ "type": "advert_stopped", "email": "test@test.ru", "campaign_id": 12, "advert_id": 44 }'
- {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "3",
- "_version" : 2,
- "_shards" : {
- "total" : 2,
- "successful" : 1,
- "failed" : 0
- },
- "created" : false
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty" -d'
- {
- "query": {
- "term": {
- "email": "test@test.ru"
- }
- }
- }'
- {
- "took" : 7,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 0,
- "max_score" : null,
- "hits" : [ ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty" -d'
- {
- "filter": {
- "term": {
- "email": "test@test.ru"
- }
- }
- }'
- {
- "took" : 3,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 0,
- "max_score" : null,
- "hits" : [ ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty" -d'
- quote> {
- quote> "filter": {
- quote> "term": {
- quote> "email": "test@test.ru"
- quote> }
- quote> }
- quote> }'
- {
- "took" : 26,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 0,
- "max_score" : null,
- "hits" : [ ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty" -d'
- quote> {
- quote> "query": {
- quote> "bool": {
- quote> "filter": [
- quote> { "term": { "email": "test@test.ru" } }
- quote> ]
- quote> }
- quote> }
- quote> }'
- {
- "took" : 38,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 0,
- "max_score" : null,
- "hits" : [ ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty" -d'
- quote> {
- quote> "_source": [
- quote> "type",
- quote> "email"
- quote> ],
- quote> "filter": {
- quote> "term": {
- quote> "email": "test@test.ru"
- quote> }
- quote> }
- quote> }'
- {
- "took" : 21,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 0,
- "max_score" : null,
- "hits" : [ ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty" -d'
- quote> {
- quote> "_source": [
- quote> "type",
- quote> "email"
- quote> ],
- quote> "filter": {
- quote> "term": {
- quote> "type": "registration"
- quote> }
- quote> }
- quote> }'
- {
- "took" : 132,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 1,
- "max_score" : 1.0,
- "hits" : [ {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "1",
- "_score" : 1.0,
- "_source" : {
- "type" : "registration",
- "email" : "test@test.ru"
- }
- } ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty" -d'
- quote> {
- quote> "_source": [
- quote> "type",
- quote> "email"
- quote> ],
- quote> "filter": {
- quote> "term": {
- quote> "email": "test@test.ru"
- quote> }
- quote> }
- quote> }'
- {
- "took" : 7,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 0,
- "max_score" : null,
- "hits" : [ ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty" -d'
- quote> {
- quote> "filter": {
- quote> "term": {
- quote> "type": "registration"
- quote> }
- quote> }
- quote> }'
- {
- "took" : 26,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 1,
- "max_score" : 1.0,
- "hits" : [ {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "1",
- "_score" : 1.0,
- "_source" : {
- "type" : "registration",
- "email" : "test@test.ru",
- "source" : "direct"
- }
- } ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty&hits" -d'
- {
- "filter": {
- "term": {
- "type": "registration"
- }
- }
- }'
- {
- "took" : 15,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 1,
- "max_score" : 1.0,
- "hits" : [ {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "1",
- "_score" : 1.0,
- "_source" : {
- "type" : "registration",
- "email" : "test@test.ru",
- "source" : "direct"
- }
- } ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty&_source" -d'
- {
- "filter": {
- "term": {
- "type": "registration"
- }
- }
- }'
- {
- "took" : 14,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 1,
- "max_score" : 1.0,
- "hits" : [ {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "1",
- "_score" : 1.0,
- "_source" : {
- "type" : "registration",
- "email" : "test@test.ru",
- "source" : "direct"
- }
- } ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty&_source" -d'
- {
- "filter": {
- "term": {
- "email": "test@test.ru"
- }
- }
- }'
- {
- "took" : 7,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 0,
- "max_score" : null,
- "hits" : [ ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty&_source" -d'
- {
- "filter": {
- "term": {
- "source": "direct"
- }
- }
- }'
- {
- "took" : 27,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 1,
- "max_score" : 1.0,
- "hits" : [ {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "1",
- "_score" : 1.0,
- "_source" : {
- "type" : "registration",
- "email" : "test@test.ru",
- "source" : "direct"
- }
- } ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty&_source" -d'
- {
- "filter": {
- "term": {
- "email": "test"
- }
- }
- }'
- {
- "took" : 7,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 3,
- "max_score" : 1.0,
- "hits" : [ {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "2",
- "_score" : 1.0,
- "_source" : {
- "type" : "campaign_created",
- "email" : "test@test.ru",
- "campaign_id" : 12,
- "platform" : "my_target"
- }
- }, {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "1",
- "_score" : 1.0,
- "_source" : {
- "type" : "registration",
- "email" : "test@test.ru",
- "source" : "direct"
- }
- }, {
- "_index" : "releadgion",
- "_type" : "user_action",
- "_id" : "3",
- "_score" : 1.0,
- "_source" : {
- "type" : "advert_stopped",
- "email" : "test@test.ru",
- "campaign_id" : 12,
- "advert_id" : 44
- }
- } ]
- }
- }
- ➜ ~ curl -XGET "http://localhost:9200/releadgion/user_action/_search?pretty&_source" -d'
- {
- "filter": {
- "term": {
- "email": "test"
- }
- }
- }'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement