Skip to content

Instantly share code, notes, and snippets.

@ajhalani
ajhalani / bool search - word separator issue
Last active August 29, 2015 14:06
elasticsearch - bool search - word separator issue
POST testindex
{
"settings": {
"number_of_shards": 1
},
"mappings": {
"document": {
"dynamic": "strict",
"_all": {
"enabled": false
@ajhalani
ajhalani / jmap summary
Last active August 29, 2015 13:56
jvm stuck high memory
$ jmap -heap 46237
Attaching to process ID 46237, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 23.6-b04
using parallel threads in the new generation.
using thread-local object allocation.
Concurrent Mark-Sweep GC
@ajhalani
ajhalani / hot_threads_1902
Last active August 29, 2015 13:56
Hot threads for a node doing merge segments very slowly
::: [machine1.node2][ghkgV2QNSPe0_mqBtPkk7A][inet[/10.126.143.197:9311]]{datacenter=nj, master=true}
75.3% (376.5ms out of 500ms) cpu usage by thread 'elasticsearch[machine1.node2][[myindex_20140211][9]: Lucene Merge Thread #155]'
2/10 snapshots sharing following 14 elements
org.apache.lucene.codecs.BlockTreeTermsWriter$TermsWriter.writeBlocks(BlockTreeTermsWriter.java:720)
org.apache.lucene.codecs.BlockTreeTermsWriter$TermsWriter$FindBlocks.freeze(BlockTreeTermsWriter.java:544)
org.apache.lucene.util.fst.Builder.freezeTail(Builder.java:214)
org.apache.lucene.util.fst.Builder.add(Builder.java:394)
org.apache.lucene.codecs.BlockTreeTermsWriter$TermsWriter.finishTerm(BlockTreeTermsWriter.java:1000)
org.apache.lucene.codecs.TermsConsumer.merge(TermsConsumer.java:112)
@ajhalani
ajhalani / ES Hot threads dump
Last active December 27, 2015 11:39
ES Hot threads dump
::: [nj1.node][ffIsTzMbSQ6521Fyj2a33w][inet[/<machine ip>:9301]]
51.5% (257.4ms out of 500ms) cpu usage by thread 'elasticsearch[nj1.node][search][T#5]'
2/10 snapshots sharing following 32 elements
org.apache.lucene.index.FilteredTermsEnum.next(FilteredTermsEnum.java:233)
org.elasticsearch.index.fielddata.ordinals.OrdinalsBuilder$3.next(OrdinalsBuilder.java:466)
org.elasticsearch.index.fielddata.plain.PackedArrayIndexFieldData.loadDirect(PackedArrayIndexFieldData.java:106)
org.elasticsearch.index.fielddata.plain.PackedArrayIndexFieldData.loadDirect(PackedArrayIndexFieldData.java:49)
org.elasticsearch.indices.fielddata.cache.IndicesFieldDataCache$IndexFieldCache$1.call(IndicesFieldDataCache.java:149)
org.elasticsearch.indices.fielddata.cache.IndicesFieldDataCache$IndexFieldCache$1.call(IndicesFieldDataCache.java:143)
@ajhalani
ajhalani / gist:6004466
Created July 15, 2013 23:34
Percolate failure for analyzed if a multi field not analyzed field with same name exists
#create index
$ curl -s -XPOST 'http://127.0.0.1:9200/testindex'
#create type with a multifield called text, which is text (analyzed) and text_not_analyzed (not_analyzed)
$ curl -s -XPOST 'http://127.0.0.1:9200/testindex/testtype/_mapping' -d '
{
"federal_register":{
"_all":{
"enabled":false
},