Skip to content

Instantly share code, notes, and snippets.

View dadoonet's full-sized avatar
🇪🇺
From Europe with ❤️

David Pilato dadoonet

🇪🇺
From Europe with ❤️
View GitHub Profile
curl -XPOST 'http://localhost:9200/spokely_development_users' -d '{"mappings":{"user":{"properties":{"id":{"index":"not_analyzed","type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"headline":{"type":"string"},"jobs":{"type":"object"},"educations":{"type":"object"},"skills":{"type":"string"},"linkedin_summary":{"type":"string"},"linkedin_groups":{"type":"string"},"linkedin_certifications":{"type":"string"},"fb_user_id":{"index":"not_analyzed","include_in_all":false,"type":"string"},"fb_connections":{"index":"not_analyzed","include_in_all":false,"type":"string"},"linkedin_id":{"index":"not_analyzed","include_in_all":false,"type":"string"},"linkedin_connections":{"index":"not_analyzed","include_in_all":false,"type":"string"},"is_active":{"type":"boolean","include_in_all":false},"is_email_confirmed":{"type":"boolean","include_in_all":false}}}},"settings":{}}'
curl -XPOST 'http://localhost:9200/spokely_development_users/user/3457' -d '{"fb_connections":[],"fb_user_id":"1314809","first_
@dadoonet
dadoonet / search.sh
Created July 28, 2012 10:33 — forked from anonymous/search more types.
searching on more types but results only for one type, please help!
curl -XDELETE 'http://localhost:9200/pms'
curl -XPUT 'http://localhost:9200/pms/Building/1' -d '
{
"id":11,
"building":{
"address":{
"street2":"test_street2_11",
"region":"test_region_11",
"id":11,
@dadoonet
dadoonet / attachment.sh
Created October 17, 2012 17:49 — forked from lukas-vlcek/gist:1075067
Test of attachments plugin
#!/bin/sh
http://cloud.github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.zip
unzip elasticsearch-0.19.10.zip
elasticsearch-0.19.10/bin/plugin -install elasticsearch/elasticsearch-mapper-attachments/1.6.0
elasticsearch-0.19.10/bin/elasticsearch
sleep 10
curl -XDELETE localhost:9200/listing
curl -XPUT localhost:9200/listing
curl -XPUT localhost:9200/listing/listing/_mapping -d '
{"listing":{"properties":{"address":{"type":"string"},
"id":{"type":"string"},
"location":{"type":"geo_point"}
}}}'
curl -X PUT localhost:9200/_percolator/listing/q1str2?pretty -d '
{"query":
// app.js
angular.module('cs_demo', [
'controllers',
'elasticjs.service',
'ui.bootstrap'
]);
@dadoonet
dadoonet / test_locale.sh
Last active December 19, 2015 05:09 — forked from anonymous/gist:5900949
Test locale with multiple formats
curl -XPUT http://localhost:9200/test/ticket/_mappinq? -d '{
"ticket" : {
"properties" : {
"DOC_CREATION_DATE" : {
"type" : "date",
"format" : "yyyy-MM-dd || yyyy-MM-dd HH:mm:ss",
"locale" : "FR"
}
}
}
@dadoonet
dadoonet / gist:6113034
Last active December 20, 2015 10:08 — forked from anonymous/gist:6109593
echo "Deleting old ElasticSearch index..."
curl -XDELETE 'localhost:9200/arrtest'; echo
echo "Creating new ElasticSearch index..."
curl -XPUT 'localhost:9200/arrtest/?pretty=1' -d '
{
"mappings" : {
"cust2" : {
"properties" : {
"firstName" : {
curl -XDELETE "http://localhost:9200/test"; echo
curl -XPUT "http://localhost:9200/test" -d'
{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"analysis": {
"analyzer": {
curl -XDELETE 'http://localhost:9200/logstash-2013.12.20/'; echo
curl -XPOST 'http://localhost:9200/logstash-2013.12.20/cloudtest' -d '
{
"responseElements": {
"instancesSet": {
"items": [
{
"instanceId": "i-1bbb1111",
"currentState": {
# Delete index
curl -s -X DELETE "http://$host:$port/multi_field_facetting" 2>&1 > /dev/null
# Create index
curl -s -X POST "http://$host:$port/multi_field_facetting" -d '
{
"settings" : {
"index": {
"analysis" : {
"filter" : {