This file contains 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 characters
curl -XPUT 'http://localhost:9200/testdb2/' -d '{index : {number_of_shards : 3, number_of_replicas : 0}}' |
This file contains 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 characters
Query: | |
{ | |
"query" : { "match_all" : {}}, "size" : 0, | |
"facets" : { | |
"message-id" : { | |
"terms" : { | |
"field" : "message-id", | |
"size" : 3, | |
"order" : "count" |
This file contains 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 characters
[2011-02-07 14:28:05,821]ERROR186038[Thread-16] - org.jboss.search.client.IndexMboxFile$Batch.execute(IndexMboxFile.java:82) - Indexing failed: | |
org.elasticsearch.transport.RemoteTransportException: [Janus][inet[/192.168.122.1:9300]][indices/index/shard/index] | |
Caused by: org.elasticsearch.index.engine.IndexFailedEngineException: [weld][0] Index failed for [mail#db199550911051438p2f675865jc9230bf30a9f8f4email.gmail.comdev615] | |
at org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:396) | |
at org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:273) | |
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:180) | |
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:428) | |
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.access$ |
This file contains 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 characters
require 'rubygems' | |
require 'net/http' | |
require 'yaml' | |
require 'json' | |
# kill the index | |
delete = Net::HTTP::Delete.new("/test") | |
# create again | |
create_index = Net::HTTP::Post.new("/test") |
This file contains 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 characters
Full thread dump OpenJDK 64-Bit Server VM (19.0-b09 mixed mode): | |
"elasticsearch[cached]-pool-1-thread-7" daemon prio=10 tid=0x00007f678c002800 nid=0x5909 waiting on condition [0x00007f677b8f7000] | |
java.lang.Thread.State: TIMED_WAITING (parking) | |
at sun.misc.Unsafe.park(Native Method) | |
- parking to wait for <0x00000000c3e27618> (a java.util.concurrent.SynchronousQueue$TransferStack) | |
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226) | |
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:453) | |
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:352) | |
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:903) |
This file contains 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 characters
org.elasticsearch.search.SearchParseException: [indexName][2]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":"*"}},"facets":{"histogram":{"date_histogram":{"field":"date","interval":"1w"}}}}]] | |
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:470) | |
at org.elasticsearch.search.SearchService.createContext(SearchService.java:385) | |
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:215) | |
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:134) | |
at org.elasticsearch.action.search.type.TransportSearchCountAction$AsyncAction.sendExecuteFirstPhase(TransportSearchCountAction.java:74) | |
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191) | |
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.access$000(TransportSearchTypeActio |
This file contains 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 characters
curl -XPUT ${host}/_template/template_mail -d ' | |
{ | |
"template" : "*", | |
"settings" : { | |
"number_of_shards" : 3, | |
"number_of_replicas" : 1 | |
}, | |
"mappings" : { | |
"mail" : { | |
"_index" : { "enabled" : true }, |
This file contains 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 characters
// start a fresh ES node with default setup and index a document | |
curl -PUT 'http://localhost:9200/devalexbk10/usr/1' -d '{ | |
{ | |
"id":2741, | |
"title":"John Doe", | |
"creationDate":"2011-02-23 13:44:14", | |
"login":"jdoe@localhost.com", | |
"firstName":"John", | |
"lastName":"Doe", | |
"locations":["1864","2","1597","1598"] |
This file contains 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 characters
curl -XDELETE http://localhost:9200/indexname | |
curl -XPUT http://localhost:9200/indexname | |
echo | |
curl -XPUT 'http://localhost:9200/indexname/histogram/_mapping?pretty=1' -d ' | |
{ | |
"histogram": | |
{ | |
"properties": | |
{ |
This file contains 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 characters
public void execute() { | |
int c = threadCounter.incrementAndGet(); | |
log.info("Starting a batch with {} items. ({} threads are running)", mails.size(), c); | |
for (JsonMail mail : mails) { | |
try { | |
IndexResponse indexResponse = ElasticSearchClient.getClient().prepareIndex() | |
.setIndex(indexName) | |
.setType("mail") | |
.setId(mail.getMessageId()) | |
.setSource(mail.getJsoncontent()) |
OlderNewer