Skip to content

Instantly share code, notes, and snippets.

View seallison's full-sized avatar

Sean Allison seallison

View GitHub Profile
@seallison
seallison / steps_to_reproduce.sh
Created October 10, 2016 22:34
Multiple Template Matching not working in Elasticsearch 2.4.1
# Create a template that defines a custom analyzer
curl -XPUT localhost:9200/_template/template_base_analysis -d '
{
"template": "*",
"order": 0,
"settings": {
"analysis": {
"analyzer": {
"body_analyzer": {
"type": "custom",
@seallison
seallison / 1st time
Created April 8, 2014 21:57
Using .script() facet - Exceptions
[2014-04-07 17:35:39,231][DEBUG][action.search.type ] [Ernst] [5] Failed to execute query phase
org.elasticsearch.search.query.QueryPhaseExecutionException: [things][3]: query[filtered(ConstantScore(++cache(cId:[12 TO 12]) +cache(state:active) cache(state:inactive) +cache(BooleanFilter(apps.5001:[* TO *]))))->cache(_type:things)],from[0],size[25]: Query Failed [Failed to execute main query]
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:121)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:296)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:236)
at org.elasticsearch.action.search.type.TransportSearchDfsQueryThenFetchAction$AsyncAction.executeQuery(TransportSearchDfsQueryThenFetchAction.java:148)
at org.elasticsearch.action.search.type.TransportSearchDfsQueryThenFetchAction$AsyncAction$2.run(TransportSearchDfsQueryThenFetchAction.java:132)
at java.util.concurrent.ThreadPoolExecuto
@seallison
seallison / gist:8681846
Created January 29, 2014 04:26
NPE when doing hasParentFilter with a nestedFilter
[2014-01-28 23:08:50,080][DEBUG][action.search.type ] [Double Helix] [3] Failed to execute fetch phase
java.lang.NullPointerException
at org.elasticsearch.index.search.child.ParentConstantScoreQuery$ChildrenWeight$ChildrenDocIdIterator.match(ParentConstantScoreQuery.java:176)
at org.apache.lucene.search.FilteredDocIdSetIterator.advance(FilteredDocIdSetIterator.java:71)
at org.elasticsearch.index.search.child.ConstantScorer.advance(ConstantScorer.java:70)
at org.apache.lucene.search.ConstantScoreQuery$ConstantScorer.advance(ConstantScoreQuery.java:217)
at org.apache.lucene.search.ConstantScoreQuery$ConstantWeight.explain(ConstantScoreQuery.java:166)
at org.apache.lucene.search.FilteredQuery$1.explain(FilteredQuery.java:102)
at org.apache.lucene.search.IndexSearcher.explain(IndexSearcher.java:672)
at org.apache.lucene.search.IndexSearcher.explain(IndexSearcher.java:652)
@seallison
seallison / gist:8031640
Last active December 31, 2015 19:09
Template mapping differences between 0.90.7 and 0.90.8
# This template_testlocations.json resides in the 'config/templates' directory.
{
"template_testlocations": {
"template": "locations*",
"mappings": {
"locations": {
"_source": {
"compress": true
},
"_all": {
@seallison
seallison / gist:7325931
Last active December 27, 2015 12:29
Example of NPE when using 'pretty' query parameter with ElasticSearch 0.90.6
import org.elasticsearch.client.Client;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestChannel;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.rest.XContentRestResponse;