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
@dadoonet
dadoonet / test_shingle.sh
Created April 23, 2013 12:37
Shingle test : how to analyze "pomme de terre" word?
# Delete the index `testindex`
curl -XDELETE 'http://localhost:9200/test' ; echo
# Create the index `testindex`
curl -XPUT 'http://localhost:9200/test' -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
},
@dadoonet
dadoonet / mlt.sh
Last active December 16, 2015 09:09
More Like This query test
# Delete the index `testindex`
curl -XDELETE 'http://localhost:9200/testindex'
# Create the index `testindex`
curl -XPUT 'http://localhost:9200/testindex' -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
}
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 3,
{
"took" : 33,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 2,
@dadoonet
dadoonet / test.sh
Created April 5, 2013 17:08
Extract domain name and compute size with terms stat facet
# Delete Test index
curl -XDELETE 'http://localhost:9200/facets_test/'
# Create index and analyzer
curl -XPUT 'http://localhost:9200/facets_test?pretty' -d '{
"settings":{
"analysis": {
"analyzer": {
"email":{
"type": "custom",
@dadoonet
dadoonet / launch.sh
Created April 4, 2013 12:45
Testing FSRiver with Mapper attachment and check metadata extracted
####### PREPARE TEST PLATFORM
### First install elasticsearch 0.20.6
# curl https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.6.zip -o elasticsearch-0.20.6.zip
# unzip elasticsearch-0.20.6.zip
# cd elasticsearch-0.20.6
### Install mapper attachment plugin
# bin/plugin -install elasticsearch/elasticsearch-mapper-attachments/1.6.0
# Print ES Version
curl 'http://localhost:9200/'
# Delete the index `testindex`
curl -XDELETE 'http://localhost:9200/testindex'
# Create the index `testindex`
curl -XPUT 'http://localhost:9200/testindex' -d '{
"settings" : {
"index" : {
@dadoonet
dadoonet / logs.sh
Created March 7, 2013 09:09
Searching with IP address and dates (logs)
curl -XDELETE http://localhost:9200/log/log/
curl -XPUT http://localhost:9200/log/log/_mapping -d '
{
"log" : {
"properties" : {
"date" : {
"type" : "date",
"format" : "dateOptionalTime"
},
@dadoonet
dadoonet / npe-fuzzy.sh
Last active December 14, 2015 04:58
NPE when doing fuzzy (tested on empty and filed index)
curl -XDELETE http://localhost:9200/npefuzzy
curl -XPUT http://localhost:9200/npefuzzy?pretty -d '{
"settings" : { "index" : { "number_of_shards" : 1, "number_of_replicas" : 0 }}
}'
curl -XPUT http://localhost:9200/npefuzzy/beer/1?pretty -d '{
"brand":"Grimbergen",
"colour":"PALE",
"size":1.3476184461445255,
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":