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:
I hereby claim:
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.auth.AuthScope; | |
import org.apache.http.auth.UsernamePasswordCredentials; |
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; |
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/' |
curl -XPOST "http://localhost:9200/index_name" -d' | |
{ | |
"mappings": { | |
"your_type": { | |
"properties": { | |
"colours": { | |
"type": "string", | |
"index": "not_analyzed" | |
} | |
} |
[2015-01-07 14:34:46,411][TRACE][org.elasticsearch.service.newrelic.NewRelicReporter] * elasticsearch.dev.node.filtercache.memorySizeInBytes: 0.0 | |
[2015-01-07 14:34:46,412][TRACE][org.elasticsearch.service.newrelic.NewRelicReporter] * elasticsearch.dev.node.filtercache.evictions: 0.0 | |
[2015-01-07 14:34:46,412][TRACE][org.elasticsearch.service.newrelic.NewRelicReporter] * elasticsearch.dev.node.idcache.memorySizeInBytes: 0.0 | |
[2015-01-07 14:34:46,412][TRACE][org.elasticsearch.service.newrelic.NewRelicReporter] * elasticsearch.dev.node.docs.count: 1.0 | |
[2015-01-07 14:34:46,412][TRACE][org.elasticsearch.service.newrelic.NewRelicReporter] * elasticsearch.dev.node.docs.deleted: 0.0 | |
[2015-01-07 14:34:46,413][TRACE][org.elasticsearch.service.newrelic.NewRelicReporter] * elasticsearch.dev.node.flush.total: 0.0 | |
[2015-01-07 14:34:46,413][TRACE][org.elasticsearch.service.newrelic.NewRelicReporter] * elasticsearch.dev.node.flush.totalTimeInMillis: 0.0 | |
[2015-01-07 14:34:46,413][TRACE][org.elasticsearch.service.newrelic |
# create an index called "services" with suggest_field mapped as "completion" with payloads | |
POST services | |
{ | |
"mappings": { | |
"service": { | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"suggest_field": { |
import java.io.IOException; | |
import org.elasticsearch.ElasticsearchException; | |
import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse; | |
import org.elasticsearch.client.Client; | |
import org.elasticsearch.client.transport.TransportClient; | |
import org.elasticsearch.common.transport.InetSocketTransportAddress; | |
public class Teste { |
from elasticsearch import Elasticsearch | |
es = Elasticsearch(hosts=[{"host": "localhost", "port": 9200}]) | |
print es.search(body={ | |
"query": { | |
"function_score": { | |
"query": { | |
"match_all": {} | |
}, |
// 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": { |