Hi,
Did you try it out ? Does it work now?
David
De : elasticsearch@googlegroups.com [mailto:elasticsearch@googlegroups.com]
De la part de hemantp
Envoyé : mardi 9 octobre 2012 19:34
À : elasticsearch@googlegroups.com
Cc : David Pilato
Objet : Re: Multisearch Java API
Yes i did clean the class path and made changes to pom as mentioned above, i
also reinstalled elastic search server again (with one node and one shard
and default index configuration) and created new project just with elastic
search dependency but i am still seeing the issue. Just to make sure that
its not related to my machine or OS, i am planning to do installation on
different OS and trying it out (I am currently testing this on OSX 10.6.8)
On Tuesday, October 9, 2012 1:54:45 AM UTC-7, David Pilato wrote:
Just a question: did you clean your project?
I'm asking this because I can see that I can modify the pom.xml with
org.elasticsearch
elasticsearch
0.19.10
fr.pilato.spring
spring-elasticsearch
0.0.2
and I get elasticsearch-0.19.10.jar in my classpath. :
I did not test it right now.
Please confirm that it works or not. If not, I will have to make deeper
tests.
David
Le 9 octobre 2012 à 06:04, hemantp <hemant.p...@gmail.com <javascript:> > a
écrit :
I tried doing the maven trick but got the same error:
pom changes:
<dependency>
fr.pilato.spring
spring-elasticsearch
0.0.2
<groupId>org.elasticsearch</groupId>
elasticsearch
</dependency>
<dependency>
org.elasticsearch
elasticsearch
0.19.10
</dependency>
Any ideas?
On Monday, October 8, 2012 2:03:40 PM UTC-7, David Pilato wrote:
I did not test it but I think that you can modify your pom.xml to ask for a
0.19.10 version?
If it does not work, it sounds like I have to release a new
spring-elasticsearch version...
Le 8 octobre 2012 à 22:51, hemantp < hemant.p...@gmail.com> a écrit :
Thanks David, yes i am using spring-elastic search integration 0.0.2 which
pulls in 0.19.4 version of elastic search whereas the server has 0.19.10
deployed on it. Is there any way to make the response compatible or should
i change the version of elastic search server to 0.19.4? are there any
options to make multi query work?
On Monday, October 8, 2012 11:49:22 AM UTC-7, David Pilato wrote:
You are probably not using the same version of ES on both sides.
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
Le 8 oct. 2012 à 20:44, hemantp < hemant.p...@gmail.com> a écrit :
I tried the code above but i am getting exception
TransportSerializationException. Any hints on what could be the issue? Below
are the details:
Elastic search version: 0.19.10
Code Snippet:
final TransportClient elasticSearchClient = new
TransportClient(elasticSearchSettings());
for (final String elasticSearchNode : elasticSearchNodes) {
elasticSearchClient.addTransportAddress(toAddress(elasticSearchNode));
}
.
.
.
//first query
SearchRequestBuilder srb1 =
elasticSearchClient.prepareSearch().setTypes(recordType)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH).setQuery(QueryBuilders.query
String(myQuery1));
//second query
SearchRequestBuilder srb2 =
elasticSearchClient.prepareSearch(index).setTypes(recordType)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH).setQuery(QueryBuilders.query
String(myQuery2));
//doing multi search
elasticSearchClient.prepareMultiSearch().add(srb1).add(srb2).execute().actio
nGet();
Exception:
org.elasticsearch.transport.TransportSerializationException: Failed to
deserialize response of type
[org.elasticsearch.action.search.MultiSearchResponse]
at
org.elasticsearch.transport.netty.MessageChannelHandler.handleResponse(Messa
geChannelHandler.java:150)
at
org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(Mess
ageChannelHandler.java:127)
at
org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUp
stream(SimpleChannelUpstreamHandler.java:75)
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(D
efaultChannelPipeline.java:565)
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannel
HandlerContext.sendUpstream(DefaultChannelPipeline.java:793)
at
org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels
.java:296)
at
org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFir
eMessageReceived(FrameDecoder.java:458)
at
org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(F
rameDecoder.java:439)
at
org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageRecei
ved(FrameDecoder.java:311)
at
org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUp
stream(SimpleChannelUpstreamHandler.java:75)
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(D
efaultChannelPipeline.java:565)
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(D
efaultChannelPipeline.java:560)
at
org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels
.java:268)
at
org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels
.java:255)
at
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.j
ava:94)
at
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.processS
electedKeys(AbstractNioWorker.java:390)
at
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(Abst
ractNioWorker.java:261)
at
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.ja
va:35)
at
org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamin
gRunnable.java:102)
at
org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadL
ockProofWorker.java:42)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja
va:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
08)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.io.IOException: Expected handle header, got [80]
at
org.elasticsearch.common.io.stream.HandlesStreamInput.readUTF(HandlesStreamI
nput.java:64)
at
org.elasticsearch.search.SearchShardTarget.readFrom(SearchShardTarget.java:9
7)
at
org.elasticsearch.search.SearchShardTarget.readSearchShardTarget(SearchShard
Target.java:81)
at
org.elasticsearch.search.internal.InternalSearchHits.readFrom(InternalSearch
Hits.java:214)
at
org.elasticsearch.search.internal.InternalSearchHits.readFrom(InternalSearch
Hits.java:200)
at
org.elasticsearch.search.internal.InternalSearchHits.readSearchHits(Internal
SearchHits.java:194)
at
org.elasticsearch.search.internal.InternalSearchResponse.readFrom(InternalSe
archResponse.java:86)
at
org.elasticsearch.search.internal.InternalSearchResponse.readInternalSearchR
esponse(InternalSearchResponse.java:80)
at
org.elasticsearch.action.search.SearchResponse.readFrom(SearchResponse.java:
284)
at
org.elasticsearch.action.search.MultiSearchResponse$Item.readFrom(MultiSearc
hResponse.java:86)
at
org.elasticsearch.action.search.MultiSearchResponse$Item.readItem(MultiSearc
hResponse.java:78)
at
org.elasticsearch.action.search.MultiSearchResponse.readFrom(MultiSearchResp
onse.java:135)
at
org.elasticsearch.transport.netty.MessageChannelHandler.handleResponse(Messa
geChannelHandler.java:148)
... 22 more
On Sunday, October 7, 2012 10:19:06 AM UTC-7, bilash wrote:
This worked!
Thanks so much David!
On Saturday, October 6, 2012 3:39:32 AM UTC-4, David Pilato wrote:
Try something like :
SearchRequestBuilder srb1 =
node.client().prepareSearch().setQuery(QueryBuilders.queryString("your query
here"));
SearchRequestBuilder srb2 =
node.client().prepareSearch().setQuery(QueryBuilders.queryString("your 2nd
query here"));
MultiSearchResponse sr =
node.client().prepareMultiSearch().add(srb1).add(srb2).execute().actionGet()
;
David
Le 6 octobre 2012 à 08:20, bilash < ghka...@gmail.com> a écrit :
There is not execute method for MultiSearchRequestBuilder that returns a
search response.
Also, there is a no add method that takes MultiSearchRequestBuilder as a
parameter.
On Saturday, October 6, 2012 1:18:24 AM UTC-4, David Pilato wrote:
Looking at code:
https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org
/elasticsearch/client/Client.java#L393
I suppose you can write something like:
client.prepareMultiSearch().add(multisearch).execute().actionGet();
<https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/or
g/elasticsearch/client/Client.java#L393>
HTH
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
<https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/or
g/elasticsearch/client/Client.java#L393>
Le 6 oct. 2012 à 04:50, bilash < ghka...@gmail.com> a écrit :
Hi,
Does anyone know how I can use the multisearch
http://www.elasticsearch.org/guide/reference/api/multi-search.html
feature using Java API?
I can create a multisearch object but how do I use it to return
MutliSearchResponse?
MultiSearchRequestBuilder multiSearch = new
MultiSearchRequestBuilder(client);
SearchRequestBuilder search =
multiSearch.add(search);
But how do I execute the search and get MultiSearchResponse back?
Any help will be greatly appreciated.
--
--
--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
--
--
--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
--
--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
--
--