Skip to content

Instantly share code, notes, and snippets.

View luizgpsantos's full-sized avatar
😁

Luiz Guilherme Pais dos Santos luizgpsantos

😁
View GitHub Profile
echo "Delete document"
curl -XDELETE 'http://localhost:8888/'
echo ""
echo "\nInitial search"
curl -XGET 'http://localhost:8888/'
echo ""
echo "\nCreate document"
curl -XPUT 'http://localhost:8888/'
# Aqui estou postando o mapping para todos os tipo do índice twitter
$ curl -XPUT 'http://localhost:1980/twitter/_mapping' -d '
{
"tweet" : {
"properties" : {
"message" : {"type" : "string", "store" : "yes"}
}
}
}
'
@luizgpsantos
luizgpsantos / ElasticsearchExample.java
Last active December 8, 2017 13:54
Java Transport Client
package test;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;

Keybase proof

I hereby claim:

  • I am luizgpsantos on github.
  • I am luizgpsantos (https://keybase.io/luizgpsantos) on keybase.
  • I have a public key ASCJGrdw4Sbh_e26BeRBFybp61FJH-om-0Ppx98OfexaGAo

To claim this, I am signing this object:

package test;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.entity.ContentType;
import org.apache.http.nio.entity.NStringEntity;
@luizgpsantos
luizgpsantos / Exemplo completo
Last active November 25, 2022 23:27
Analyzer para plural e acentos no elasticsearch
// Ao [criar o índice][0], especifique um [analyzer customizado][1] responsável por tratar palavras
// com caracteres especiais e o plural da lingua Portuguesa. Algumas palavras precisarão de uma
// sintonia fina, o que pode ser feito através de [stemmer overrides][2]. Além disso, ao criar um
// campo atribua o analyzer a ele.
PUT produtos
{
"settings": {
"analysis": {
"analyzer": {