Skip to content

Instantly share code, notes, and snippets.

View imotov's full-sized avatar

Igor Motov imotov

View GitHub Profile
curl -XDELETE 'http://localhost:9200/test-idx'
echo
curl -XPUT 'http://localhost:9200/test-idx' -d '{
"mappings": {
"article": {
"properties": {
"a": {
"type": "integer"
},
"b": {
curl -XPUT 'http://localhost:9200/test50k' -d '{
"settings": {
"analysis": {
"analyzer": {
"my_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": "standard, lowercase, hunspell_hr"
}
},
@imotov
imotov / elasticsearch.yml
Created April 2, 2012 10:32
elasticsearch-jetty Basis Auth Configuration
http.type: com.sonian.elasticsearch.http.jetty.JettyHttpServerTransportModule
curl -XDELETE http://localhost:9200/test-idx
echo
curl -XPUT http://localhost:9200/test-idx -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
}
},
"mappings" : {
curl -XDELETE 'http://localhost:9200/test-idx'
echo
curl -XPUT 'http://localhost:9200/test-idx' -d '
{
"mappings": {
"doc": {
"properties" : {
"checkByte": {"type": "byte", "store": "yes" }
}
}
@imotov
imotov / porter_vs_2.sh
Created November 29, 2012 01:03
Porter vs Porter2
curl -XDELETE localhost:9200/test-idx
curl -XPUT localhost:9200/test-idx -d '{
"index": {
"analysis": {
"analyzer": {
"porter1": {
"tokenizer": "standard",
"filter": ["lowercase", "porter1"]
},
"porter2": {
curl -XDELETE localhost:9200/test-idx
echo
curl -XPUT localhost:9200/test-idx -d '{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
}
},
"mappings": {
curl -XDELETE 'http://localhost:9200/test-idx'
echo
curl -XPUT 'http://localhost:9200/test-idx' -d '
{
"settings": {
"index.number_of_shards" : 1
},
"mappings": {
"doc": {
"properties" : {
curl -XDELETE 'http://localhost:9200/test-idx'
echo
curl -XPUT 'http://localhost:9200/test-idx' -d '{
"mappings" : {
"document" : {
"properties" : {
"tags" : {
"type" : "nested",
"properties" : {
"tag" : { "type" : "string", "index": "not_analyzed" },
curl -XDELETE 'http://localhost:9200/test-idx'
echo
curl -XPUT 'http://localhost:9200/test-idx'
echo
echo
echo "**** Standard analyzer ****"
curl 'http://localhost:9200/test-idx/_analyze?pretty=true' -d 'This is a test of vamsikrishna@gmail.com'
echo
curl -XDELETE 'http://localhost:9200/test-idx'
echo