Skip to content

Instantly share code, notes, and snippets.

View imotov's full-sized avatar

Igor Motov imotov

View GitHub Profile
$ curl -XPUT localhost:9200/test-idx/doc/1 -d '{"foo": "BaR"}'
{"ok":true,"_index":"test-idx","_type":"doc","_id":"1","_version":1}
$ curl "localhost:9200/test-idx/doc/_search?q=baR&pretty"
{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
curl -XDELETE localhost:9200/test-idx
curl -XPUT localhost:9200/test-idx -d '{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0,
"analysis": {
"analyzer": {
"region_analyzer": {
"tokenizer": "my_ngram"
curl -XDELETE localhost:9200/test-idx
curl -XPUT localhost:9200/test-idx -d '{
"settings": {
"index": {
"number_of_replicas": 0,
"number_of_shards": 1
}
},
"mappings": {
"doc": {
#!/bin/bash
curl -XDELETE 'http://localhost:9200/test-data/'
curl -XPUT 'http://localhost:9200/test-data/' -d '{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0,
"mapper.dynamic": false,
"analysis": {
"analyzer": {
@imotov
imotov / gist:5554678
Last active December 17, 2015 04:59 — forked from baxford/gist:5551877
curl -XDELETE 'http://localhost:9200/app'
curl -XPUT 'http://localhost:9200/app' -d '
{
"settings": {
"index.number_of_shards": 1,
"index.number_of_replicas": 0
},
"mappings" : {
"parent": {
"properties" : {
curl -XDELETE "http://localhost:9200/test/"
curl -XPUT "http://localhost:9200/test/" -d '{
"mappings": {
"product": {
"properties": {
"doc": {
"properties": {
"name": {
"type": "string",
"include_in_all": true
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test -d '{
"mappings": {
"post": {
"_source": {
"enabled": false
},
"properties": {
"date": {
"type": "long",
curl -XDELETE "localhost:9200/test"
curl -XPUT "localhost:9200/test" -d '{
"mappings": {
"doc": {
"properties": {
"price": {
"type": "long"
},
"colour": {
"type": "string",
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test -d '{
"settings": {
"index.number_of_shards": 1,
"index.number_of_replicas": 0
}
}
'
curl -XPOST localhost:9200/test/doc/1 -d '{
"foo": 1,
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test -d '{
"settings": {
"index.number_of_shards": 1,
"index.number_of_replicas": 0
}
}
'
curl -XPOST localhost:9200/test/doc/1 -d '{
"dna":[