Hi,
I'm in the progress of creating a custom C# client for elastic search with
RestSharp http://restsharp.org/.
Everything works without a problem except searching.
I'm indexing this document:
{
"Content": "Hello!",
"User": "Arxisos"
}
And after that I start the search request:
POST http://http//localhost:9200/twitter/tweet/_search HTTP/1.1
Accept: application/json, application/xml, text/json, text/x-json,
text/javascript, text/xml, application/json
User-Agent: RestSharp 102.3.0.0
Content-Type: application/json
Host: http
Content-Length: 82
Accept-Encoding: gzip, deflate
Proxy-Connection: Keep-Alive
{
"query":{
"fuzzy":{
"User":{
"value":"Arxksos",
"min_similarity":0.1
}
}
}
}
Often that works without any problem:
{
"took":2,
"timed_out":false,
"_shards":{
"total":5,
"successful":5,
"failed":0
},
"hits":{
"total":1,
"max_score":0.3068528,
"hits":[
{
"_index":"twitter",
"_type":"tweet",
"_id":"1",
"_score":0.3068528,
"_source":{
"Content":"Hello!",
"User":"Arxisos"
}
}
]
}
}
But sometimes elasticsearch returns with an empty result:
{
"took":1,
"timed_out":false,
"_shards":{
"total":5,
"successful":5,
"failed":0
},
"hits":{
"total":0,
"max_score":null,
"hits":[]
}
}
After looking in the log file I found this:
[2011-10-31 22:07:43,368][WARN ][http.netty ] [Projector] Caught exception
while handling client http traffic, closing connection
java.io.IOException: Eine vorhandene Verbindung wurde vom Remotehost
geschlossen
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(Unknown Source)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.read(Unknown Source)
at sun.nio.ch.SocketChannelImpl.read(Unknown Source)
at
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:321)
at
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:280)
at
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:200)
at
org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at
org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:44)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
The exception has a german description because my operating system's
language is german.
Here is the english translation: An existing connection was closed by the
remote host.
Do you thing the error is in my client implementation? Do I make a fault
when creating the http request?
I would be happy if someone can give some tips to solve this problem.
Thanks for reading,
Steffen