Skip to content

Instantly share code, notes, and snippets.

View luizgpsantos's full-sized avatar
😁

Luiz Guilherme Pais dos Santos luizgpsantos

😁
View GitHub Profile
@luizgpsantos
luizgpsantos / gist:031fb36af5545afde29b
Created September 1, 2014 20:16
Update nested document
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test -d '{
"settings": {
"index.number_of_shards": 1,
"index.number_of_replicas": 0
},
"mappings": {
"car": {
"properties": {
"creators" : {
@luizgpsantos
luizgpsantos / gist:a8ea5743cfe96aea478d
Last active August 29, 2015 14:05
Otimização de filtros
Query inicial
-------------------------
POST _search
{
"query": {
"bool": {
"must": [
{
"term": {
@luizgpsantos
luizgpsantos / gist:b751724fc6267a9ae2d8
Created July 25, 2014 02:17
Contador de palavras
PUT indice_teste
{
"settings": {
"analysis": {
"analyzer": {
"pt_analyzer": {
"type": "custom",
"filter": [
"stop_noise",
"lowercase"
@luizgpsantos
luizgpsantos / gist:9216108
Last active August 29, 2015 13:56
Compute TF/IDF across indexes
curl -XPUT localhost:9200/index1/type/1 -d '{
"title": "alice dance"
}'
curl -XPUT localhost:9200/index1/type/2 -d '{
"title": "alice jump"
}'
curl -XPUT localhost:9200/index1/type/3 -d '{
"title": "alice run"
http://localhost:9200/_view/index_test/type_test/1
{
"error": "RemoteTransportException[[localhost][inet[/10.11.32.11:9300]][view/s]]; nested: NullPointerException; ",
"status": 500
}
[2014-02-13 17:27:19,402][DEBUG][action.view ] [localhost] [index_test][0]: failed to execute [org.elasticsearch.action.view.ViewRequest@401b8cc4]
org.elasticsearch.transport.RemoteTransportException: [localhost][inet[/10.11.32.11:9300]][view/s]
Caused by: java.lang.NullPointerException
# 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"}
}
}
}
'