Issue with elastic search TransportClient of java API

Hi David,

I have identified the problem. Actually the transport client that i was
creating was like this:

Settings settings =
ImmutableSettings.settingsBuilder().put("client.transport.sniff",
true).build();
client = new TransportClient(settings).addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));

However if turn off the sniff portion then its working fine.

I am testing in a single node cluster so why does setting *sniff *property
to true is causing the problem?

On Friday, September 26, 2014 12:33:46 PM UTC+5:30, Vijay Tiwary wrote:

I am using Elasticsearch 1.2.1 and java client for the same is 1.3.2

On Friday, September 26, 2014 12:24:24 PM UTC+5:30, David Pilato wrote:

Just checking. Which version you elasticsearch cluster is?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 26 sept. 2014 à 08:28, Vijay Tiwary vijaykr...@gmail.com a écrit :

Blow is the junit test class:

public class BenchMarkES {
private static final Logger LOG =
LoggerFactory.getLogger(BenchMarkES.class);
private static TransportClient client = null;
@Before
public void setUp() {
Settings settings = ImmutableSettings.settingsBuilder().build();
client = new TransportClient(settings).addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));
}
@Test
public void doNormalQuery(){
try{
int queryExecutionCount = 5;
SearchResponse sr = null;
FilterBuilder filter = FilterBuilders.termFilter("brand_context_id","5");
long start = System.currentTimeMillis();
for (int i = 0; i < queryExecutionCount; i++) {
sr = launchSearch(filter, 2000);
}
long end = System.currentTimeMillis();
LOG.info("Time taken for the normal quelry "+(end - start)+" ms");
SearchHits sh = sr.getHits();
SearchHit searchHit = sh.getHits();
LOG.info("Hits :"+sh.getTotalHits()+", Docs fetched
:"+searchHit.length);
/for (SearchHit doc : searchHit) {
LOG.info("Document :"+doc.getSource().get("tweet_id"));
}
/
}catch (Exception e) {
LOG.error(e.getMessage(), e);
}
}
private SearchResponse launchSearch(FilterBuilder filter, int size)
throws IOException {

FilteredQueryBuilder fqb = new
FilteredQueryBuilder(QueryBuilders.matchAllQuery(), filter);
SearchRequestBuilder srb =
client.prepareSearch("twitter").setTypes("tweet").setQuery(fqb);
if(aggregation != null){

srb.addAggregation(aggregation);
}
srb.setFrom(0).setSize(size);
SearchResponse response = srb.execute().actionGet();

    return response;
}

}

So the problem is this if i execute the block
* for (int i = 0; i < queryExecutionCount; i++) {*

  • sr = launchSearch(filter, 2000);*
  • }*

with "queryExecutionCount" set to 1 it works however if I set to any
value greater than 1 it fails

On Friday, September 26, 2014 11:49:07 AM UTC+5:30, David Pilato wrote:

How your Java code looks like?
What was your curl query?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 26 sept. 2014 à 07:34, Vijay Tiwary vijaykr...@gmail.com a écrit :

I am having a instance of "TransportClient" which is singleton in my
web application. In one of the flow I have to query Elasticsearch twice
one after the other. However, first call to Elasticsearch cluster is
working and the other one is failing with the following exception:

No valid missing index type id: 38
org.elasticsearch.ElasticsearchIllegalArgumentException: No valid
missing index type id: 38
at
org.elasticsearch.action.support.IndicesOptions.readIndicesOptions(IndicesOptions.java:111)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.action.search.SearchRequest.readFrom(SearchRequest.java:505)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.transport.netty.MessageChannelHandler.handleRequest(MessageChannelHandler.java:209)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:109)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(OpenChannelsHandler.java:74)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
~[elasticsearch-1.3.2.jar:na]
at
org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
~[elasticsearch-1.3.2.jar:na]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
~[na:1.8.0_11]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
~[na:1.8.0_11]
at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_11]

There is no problem with the query that I have checked with curl. What
is problem here?

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/46210f90-f49b-4bd6-a583-1ad6f13dd7c2%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/46210f90-f49b-4bd6-a583-1ad6f13dd7c2%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/7f127ee3-45c1-44a6-8a2a-62294f7aba37%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/7f127ee3-45c1-44a6-8a2a-62294f7aba37%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8d1c25cc-2562-4914-9789-70ec091b54f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.