-
-
Save thyagobr/e416f9d4dd273fc5463d to your computer and use it in GitHub Desktop.
Revisions
-
thyagobr renamed this gist
Feb 9, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
luizgpsantos revised this gist
Sep 4, 2014 . 1 changed file with 10 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ //Cria o índice especificando quais os analyzer ele tem //Além disso especifica que o campo "titulo" do tipo "seu_tipo" utiliza o analyzer recem criado curl -XPUT "http://localhost:9200/my_index" -d' { "settings": { "analysis": { @@ -33,41 +33,40 @@ PUT /my_index } } } }' //Indexa os seus documentos, que podem conter acentos, maiusculas, etc... curl -XPUT "http://localhost:9200/my_index/seu_tipo/1" -d' { "titulo": "está ações lugares melhorias nível Nível" }' //Realiza uma busca por um termo sem acento, ç, etc... curl -XPOST "http://localhost:9200/my_index/_search" -d' { "query": { "match": { "titulo": "esta acoes" } } }' //Outro exemplo de query... curl -XPOST "http://localhost:9200/my_index/_search" -d' { "query": { "match": { "titulo": "nivel" } } }' // Isso daqui é usado só para endender como o seu analyzer está funcionando. curl -XGET "http://localhost:9200/my_index/_analyze?analyzer=analyzer_customizado" -d' { está ações lugares melhorias nível Nível }' -
luizgpsantos revised this gist
Sep 4, 2014 . 1 changed file with 73 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,73 @@ //Cria o índice especificando quais os analyzer ele tem //Além disso especifica que o campo "titulo" do tipo "seu_tipo" utiliza o analyzer recem criado PUT /my_index { "settings": { "analysis": { "analyzer": { "analyzer_customizado": { "tokenizer": "standard", "filter": [ "lowercase", "stemmer_plural_portugues", "asciifolding" ] } }, "filter": { "stemmer_plural_portugues": { "type": "stemmer", "name": "minimal_portuguese" } } } }, "mappings": { "seu_tipo": { "properties": { "titulo": { "type": "string", "analyzer": "analyzer_customizado" } } } } } //Indexa os seus documentos, que podem conter acentos, maiusculas, etc... PUT my_index/seu_tipo/1 { "titulo": "está ações lugares melhorias nível Nível" } //Realiza uma busca por um termo sem acento, ç, etc... POST my_index/_search { "query": { "match": { "titulo": "esta acoes" } } } //Outro exemplo de query... POST my_index/_search { "query": { "match": { "titulo": "nivel" } } } // Isso daqui é usado só para endender como o seu analyzer está funcionando. GET /my_index/_analyze?analyzer=analyzer_customizado { está ações lugares melhorias nível Nível } -
luizgpsantos renamed this gist
Sep 4, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
luizgpsantos created this gist
Sep 4, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ curl -XPUT "http://localhost:9200/my_index" -d' { "settings": { "analysis": { "analyzer": { "analyzer_customizado": { "tokenizer": "standard", "filter": [ "lowercase", "stemmer_plural_portugues", "asciifolding" ] } }, "filter": { "stemmer_plural_portugues": { "type": "stemmer", "name": "minimal_portuguese" } } } } }' curl -XGET "http://localhost:9200/my_index/_analyze?analyzer=analyzer_customizado" -d' { está ações lugares melhorias nível Nível }'