Skip to content

Instantly share code, notes, and snippets.

@lmader
lmader / curl_repro.txt
Created August 7, 2012 23:22
shardFailures in SearchResponse showing from previous query
Steps to repro issue with the shardFailures array showing msgs from a previous (not current) query:
1) create something
curl -XPUT localhost:9200/acme/blog/1111 -d '{"message":"foo"}'
2) execute this query, it should succeed
curl -XGET localhost:9200/acme/blog/_search -d '{"query":{"field":{"message":"foo"}}}'
3) this is an invalid query and is expected to fail
curl -XGET localhost:9200/acme/blog/_search -d '{"foobar":{"message":"foo"}}'
{ "_id" : "content_b0a7367eea8849998609bffd55c8aa48", "isReady" : true, "numFavorites" : 0, "backRefs" : [ ], "attributesByPath" : { "/Topics/Systems" : [ ], "/Competencies/Technical Knowledge/Financial Knowledge" : [ ], "/Competencies" : [ ], "/Discipline/Finance/FP&A" : [ ], "/Topics/Systems/Hyperion" : [ ], "/Topics" : [ ], "/Content" : [ { "_id" : "TextAttribute_c4fed597776b4508a07568db6288e40b", "@class" : "com.intrepidls.mlp.model.metadata.AttributeRef", "name" : "sourceId" }, { "_id" : "TextAttribute_f667d9fc2ef9482db2e771268d7ea741", "@class" : "com.intrepidls.mlp.model.metadata.AttributeRef", "name" : "durationType" }, { "_id" : "TextAttribute_84b2d25f1e7341139cc130b99c2195a6", "@class" : "com.intrepidls.mlp.model.metadata.AttributeRef", "name" : "keywords" }, { "_id" : "TextAttribute_f31779cf37ef497fb483450bbc998b62", "@class" : "com.intrepidls.mlp.model.metadata.AttributeRef", "name" : "managedBy" }, { "_id" : "
@lmader
lmader / ElasticTestParentChild2.java
Created July 20, 2011 23:09
Demonstrates a problem with the uid not getting stored in the index.
/**
*
* Demonstrates a problem with the uid not getting stored in the index.
* Note that the _source for the child document must be disabled to see the problem.
* When the problem occurs, the match_all query fails.
* The program loops on creating parent/child docs and then executing the match_all query.
* Eventually fails with:
*
* [shard [[ISnbIZInTo2W6N_DSq1sdg][acme][2]], reason
@lmader
lmader / ElasticTest.java
Created April 14, 2011 20:02
Demonstrates a possible issue in elasticsearch with the parent/child feature.
/**
*
* Also see comments on the function main().
*
* Depends only on the libs that come with elasticsearch:
* elasticsearch-0.15.2.jar
* lucene*.jar
*
* Place the ElasticTest.java file and the above jars in the same folder.
@lmader
lmader / ElasticTest.java
Created April 14, 2011 18:56
Demonstrates a possible concurrency bug in the elasticsearch parent\child feature
/**
* Requires a file called document1.pdf. See the class member declaration below to edit the path.
*
* Also see comments on the function main().
*
* Depends only on the libs that come with elasticsearch:
* elasticsearch-0.15.2.jar
* lucene*.jar
*
* Place the ElasticTest.java file and the above jars in the same folder.