Skip to content

Instantly share code, notes, and snippets.

[2012-07-03 11:35:57,621][INFO ][node ] [Xandu_71f67394-f394-4f56-bf3a-de677bb8099b] {0.19.0}[16798]: stopping ...
[2012-07-03 11:35:58,939][DEBUG][action.search.type ] [Xandu_71f67394-f394-4f56-bf3a-de677bb8099b] [226577095] Failed to execute fetch phase
org.elasticsearch.search.SearchContextMissingException: No search context found for id [226577095]
at org.elasticsearch.search.SearchService.findContext(SearchService.java:451)
at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:424)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteFetch(SearchServiceTransportAction.java:344)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.executeFetch(TransportSearchQueryThenFetchAction.java:149)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$2.run(TransportSearchQueryThenFetchAction.java:136)
at java.util.concurrent.Th
$ curl -XPUT 'http://localhost:9200/index1/type1/1' -d '{
"type1" : {
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "trying out Elastic Search"
}
}'
--------------------------Search with an invalid query-----------------------------------
@enguzekli
enguzekli / gist:1034810
Created June 19, 2011 21:49
Strange Smile Bug
import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
import org.elasticsearch.action.get.GetRequest;
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexResponse;
@enguzekli
enguzekli / gist:949511
Created April 30, 2011 07:19
IN query
def query = QueryBuilders.inQuery("type1index", "type1", "relatedObjectIdPropetyInChild", QueryBuilders.....)
SearchRequest searchRequest = new SearchRequest();
SearchSourceBuilder ssb = new SearchSourceBuilder();
ssb.query(query);
searchRequest.source(ssb);
searchRequest.indices(new String[]{"type2index"});
searchRequest.types("type2");
client.search(searchRequest)
@enguzekli
enguzekli / gist:949501
Created April 30, 2011 07:12
Running child query alone and in hasChildQuery method
String indexName = "perftestIndex"
String childType = "child"
String parentType = "parent"
QueryStringQueryBuilder childQuery = QueryBuilders.queryString("value:1");
//When I run this query on and continuously updated index it runs very fast and returns at most in 5 msecs
SearchRequest searchRequest = new SearchRequest();
SearchSourceBuilder ssb = new SearchSourceBuilder();
ssb.query(childQuery);
searchRequest.source(ssb);