Skip to content

Instantly share code, notes, and snippets.

View imotov's full-sized avatar

Igor Motov imotov

View GitHub Profile
Запрос 1:
POST tenders_2019/_doc/_search
{
"_source": false,
"timeout": "3m",
"query": {
"bool": {
"filter": [
{
"bool": {
@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 -XPOST http://localhost:9200/test/thing/1 -d '{
"something": "/hello/world"
}'
@imotov
imotov / has-child-on-contact.sh
Created September 25, 2012 21:50 — forked from andreasch/has-child-on-contact.sh
Querying a parent type that is also a child type for another type
#!/bin/bash
echo "Performing a has_child search on contacts"
curl -XGET 'http://localhost:9200/contact/_search?pretty=true' -d '
{
"query" : {
"filtered" : {
"query" : {
"match_all" : { }
},
"filter" : {
@imotov
imotov / stop-words-test.log
Created April 11, 2012 16:10 — forked from kwloafman/stop-words-test.log
Stop Words in Quoted vs Unquoted Search
{"ok":true,"acknowledged":true}
{"ok":true,"acknowledged":true}
{"ok":true,"_index":"test","_type":"content","_id":"1","_version":1}
{"ok":true,"_index":"test","_type":"content","_id":"2","_version":1}
{"ok":true,"_shards":{"total":10,"successful":5,"failed":0}}
{
"took" : 7,
"timed_out" : false,
"_shards" : {
"total" : 5,
@imotov
imotov / geo_distance_test
Created June 23, 2011 21:08 — forked from mauricioalarcon/geo_distance_test
geo_distance test for ES
# Delete all pins
curl -X DELETE "http://localhost:9200/pins/pin"
# Create proper mapping
curl -XPUT 'http://localhost:9200/pins/pin/_mapping' -d '
{
"pin" : {
"properties" : {
"location" : {
"type" : "geo_point"