Skip to content

Instantly share code, notes, and snippets.

@cedufca
Created July 28, 2011 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cedufca/1a92fe00ddbd71806892 to your computer and use it in GitHub Desktop.
Save cedufca/1a92fe00ddbd71806892 to your computer and use it in GitHub Desktop.
ElasticSearch asciifolding
$ curl -XGET 'http://localhost:9200/generics/_settings'
> {"generics":{"settings":{"index.number_of_shards":"5","index.number_of_replicas":"1"}}}
Then I removed data/ and did:
$ curl -XPUT 'http://localhost:9200/generics' -d '
index:
analysis:
analyzer:
default:
tokenizer: standard
type: standard
filter: [standard, lowercase, stop, asciifolding]
'
Ok, now getting it again returns me:
{"generics":{"settings":{"index.analysis.analyzer.default.filter.1":"lowercase","index.analysis.analyzer.default.filter.2":"stop","index.analysis.analyzer.default.filter.0":"standard","index.analysis.analyzer.default.filter.3":"asciifolding","index.analysis.analyzer.default.tokenizer":"standard","index.analysis.analyzer.default.type":"standard","index.number_of_shards":"5","index.number_of_replicas":"1"}}}
Indexed the following:
{:account_id=>49, "title"=>"Botão Curta essa página", :breadcrumb=>[49, 753, 939, 941, 11970, 11971], "updated_at"=>Fri Jul 01 14:38:59 UTC 2011, "folder_id"=>11971, "id"=>7032, "created_for_user"=>true, "description"=>"Botão curtir para Facebook\n", :folder_id=>11971}
And tried to search for 'botao*'
No results.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment