Skip to content

Instantly share code, notes, and snippets.

View umeshdangat's full-sized avatar

Umesh Dangat umeshdangat

View GitHub Profile
@umeshdangat
umeshdangat / index_binary_doc_values.sh
Last active November 12, 2016 22:45
Index docs with binary field type
curl -s -XPUT "http://localhost:9200/testindex/" -d '{
"settings": {
"index.number_of_shards": 1,
"index.number_of_replicas": 0
},
"mappings": {
"test":{"_all":{"enabled":false},
"properties":{
"qa_data":{"type":"binary", "doc_values": true}
}
curl -XGET 'localhost:9200/testindex/_search?pretty' -d'
{
"query": {
"function_score": {
"script_score": {
"script": {
"lang": "painless",
"inline": "String foo = doc[\u0027qa_data\u0027].get(0).toString(); return 200;"
}
}
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 2,
package com.sample.elasticsearch.plugins.sample;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.index.fielddata.ScriptDocValues;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.plugins.ScriptPlugin;
import org.elasticsearch.script.AbstractDoubleSearchScript;
import org.elasticsearch.script.ExecutableScript;
import org.elasticsearch.script.NativeScriptFactory;
"caused_by" : {
"type" : "script_exception",
"reason" : "runtime error",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "Can't load fielddata on [qa_data] because fielddata is unsupported on fields of type [binary]. Use doc values instead."
},
@umeshdangat
umeshdangat / jstack
Last active August 30, 2017 21:05
GlobalOrdinals:getOrdinals
"elasticsearch[ip][search][T#13]" #153 daemon prio=5 os_prio=0 tid=0x00007fb5e0102800 nid=0xd6c8 runnable [0x00007fb002c83000]
java.lang.Thread.State: RUNNABLE
at java.lang.ThreadLocal$ThreadLocalMap.getEntryAfterMiss(ThreadLocal.java:444)
at java.lang.ThreadLocal$ThreadLocalMap.getEntry(ThreadLocal.java:419)
at java.lang.ThreadLocal$ThreadLocalMap.access$000(ThreadLocal.java:298)
at java.lang.ThreadLocal.get(ThreadLocal.java:163)
at org.apache.lucene.util.CloseableThreadLocal.get(CloseableThreadLocal.java:78)
at org.apache.lucene.index.CodecReader.getSortedSetDocValues(CodecReader.java:250)
at org.apache.lucene.index.FilterLeafReader.getSortedSetDocValues(FilterLeafReader.java:460)
at org.apache.lucene.index.DocValues.getSortedSet(DocValues.java:302)
@umeshdangat
umeshdangat / GlobalOrdinalMapping_advanceExact_failed
Created August 30, 2017 19:10
GlobalOrdinalMapping advanceExact failing test
2> REPRODUCE WITH: gradle :core:integTest -Dtests.seed=12650C8218D1B008 -Dtests.class=org.elasticsearch.search.profile.aggregation.AggregationProfilerIT -Dtests.security.manager=true -Dtests.locale=en-US -Dtests.timezone=America/Los_Angeles
2> REPRODUCE WITH: gradle :core:integTest -Dtests.seed=12650C8218D1B008 -Dtests.class=org.elasticsearch.search.profile.aggregation.AggregationProfilerIT -Dtests.security.manager=true -Dtests.locale=en-US -Dtests.timezone=America/Los_Angeles
2> NOTE: test params are: codec=Asserting(Lucene70): {_field_names=PostingsFormat(name=Asserting), _id=PostingsFormat(name=Asserting), tag=PostingsFormat(name=Asserting), string_field=PostingsFormat(name=Asserting)}, docValues:{_seq_no=DocValuesFormat(name=Lucene70), number=DocValuesFormat(name=Lucene70), tag=DocValuesFormat(name=Asserting), _primary_term=DocValuesFormat(name=Asserting), _version=DocValuesFormat(name=Lucene70), string_field=DocValuesFormat(name=Lucene70)}, maxPointsInLeafNode=1065, maxMBSortInHeap=6.359576999794083,
@umeshdangat
umeshdangat / gist:29d77590a2711326181a0ab68e2054d1
Created November 10, 2017 23:33 — forked from hay/gist:1351230
Enterprisify your Java Class Names!
<!doctype html>
<html>
<head>
<title></title>
<style>
body {
background: white;
text-align: center;
padding: 20px;
font-family: Georgia, serif;
{
"name": "feature_one_lunch",
"params": [
"feature_one_lunch_query",
"feature_one_lunch_language",
"feature_one_lunch_clicks",
"feature_one_lunch_impressions"
],
"template_language": "mustache",
"template": {
@umeshdangat
umeshdangat / id_rsa.pub
Created August 1, 2018 15:01
public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLo0Kvp8ixWZy9kWn/qGCzBFvUQc5Ve0yxCrNHT5jDKMn1DLMA2JKhLnKpgEfdWwXoIdug4LcW1uqBAa39hGwNb2y0pXloijqyARpnf8GgQvpfxteB7Okc92lkDC8o2dhzrTAmiEmH8ptk1xjBpSigNHfhze3Y64y2Zja2koYKh97Igss1ZxwFjNIs/nV5zk/01BLkE/qbDb7dBRaQJLQtP40/iIsDJWrD3Euu5u+Wckjlep5swUQra/9M9+bMXhEXsLyUG/GEgrQmyGhFPuW3dkuUfdb8zoqFnTT2iZgDr7intRB9TtXuLQqrr0rxBts4af37VB+P4fhRGq/3dYuv umesh@C02VR3V9HTD8