Created
April 4, 2012 13:58
-
-
Save emilis/2301281 to your computer and use it in GitHub Desktop.
Hunspell_lt for ElasticSearch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"index": { | |
"mappings": { | |
"item": { | |
"properties": { | |
"name": { | |
"type": "string", | |
"analyzer": "text_lt" | |
} | |
} | |
} | |
}, | |
"analysis": { | |
"filter": { | |
"snowball_lt": { | |
"type": "snowball", | |
"language": "Lithuanian" | |
}, | |
"hunspell_lt": { | |
"locale": "lt_LT", | |
"ignoreCase": true, | |
"type": "hunspell" | |
} | |
}, | |
"analyzer": { | |
"lowercase_keyword": { | |
"filter": [ "lowercase" ], | |
"type": "custom", | |
"tokenizer": "keyword" | |
}, | |
"text_lt": { | |
"filter": [ "standard", "lowercase", "stop", "hunspell_lt" ], | |
"type": "custom", | |
"tokenizer": "standard" | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -e "Deleting index testas" | |
curl -XDELETE 'http://localhost:9200/testas/' | |
echo -e "\nCreating index testas" | |
curl -XPUT 'http://localhost:9200/testas/' -d @test-index.json | |
sleep 1 | |
echo -e "\nAdding test item" | |
curl -XPUT 'http://localhost:9200/testas/item/1' -d @test-item.json | |
sleep 1 | |
echo -e "\nSearching for 'skani':" | |
curl 'http://localhost:9200/testas/item/_search?q=name:skani' | |
echo -e "\nSearching for 'varškė':" | |
curl 'http://localhost:9200/testas/item/_search?q=name:varškė' | |
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name":"Skani varškė"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Elasticsearch server output: