I try to work with the new completion suggester (0.90.3) through java API,
but i get this error :
Suggest Response[Error: Can not write a field name, expecting a value]
This a sample code that i execute :
//client is a transport client
client.prepareSuggest("myIndex")
.addSuggestion(new CompletionSuggestionBuilder("")
.field("tag")
.text("foo")
.size(10))
.execute().actionGet();
If i use "prepareSearch" instead of "prepareSuggest" this work
correctly (searchs results+suggestions).
Could you please post the stacktrace of the error you get back? You should
see it in the elasticsearch log too.
Thanks
On Tuesday, September 10, 2013 10:56:30 AM UTC+2, LudoN4R4 wrote:
Hello,
I try to work with the new completion suggester (0.90.3) through java API,
but i get this error :
Suggest Response[Error: Can not write a field name, expecting a value]
This a sample code that i execute :
//client is a transport client
client.prepareSuggest("myIndex")
.addSuggestion(new CompletionSuggestionBuilder("")
.field("tag")
.text("foo")
.size(10))
.execute().actionGet();
If i use "prepareSearch" instead of "prepareSuggest" this work
correctly (searchs results+suggestions).
I could retrieve my "completions informations" but i've the mentionned
error if i try to outprint directly the response object (it's not blockingfor me).
This is my test code (scala):
*//client is a transport client*
*val* suggestResponse = client.prepareSuggest("myIndex")
.addSuggestion(*new*CompletionSuggestionBuilder("test_case")
.field("tag")
.text("foo")
.size(10))
.execute().actionGet();
*//print suggest response to console*
println(suggestResponse) *// Suggest Response[Error: Can not write a
*while* (it.hasNext()) {
println(it.next().getText()) *// works fine print each expected
fields*
}
On Tuesday, September 10, 2013 9:17:28 PM UTC+4, Luca Cavanna wrote:
Could you please post the stacktrace of the error you get back? You should
see it in the elasticsearch log too.
Thanks
On Tuesday, September 10, 2013 10:56:30 AM UTC+2, LudoN4R4 wrote:
Hello,
I try to work with the new completion suggester (0.90.3) through java
API, but i get this error :
Suggest Response[Error: Can not write a field name, expecting a value]
This a sample code that i execute :
//client is a transport client
client.prepareSuggest("myIndex")
.addSuggestion(new CompletionSuggestionBuilder("")
.field("tag")
.text("foo")
.size(10))
.execute().actionGet();
If i use "prepareSearch" instead of "prepareSuggest" this work
correctly (searchs results+suggestions).
Hi,
thanks to your reply I was able to understand where the problem was.
Nothing blocking, but still a bug in the SuggestResponse#toString method,
which was throwing that exception all the time.
I could retrieve my "completions informations" but i've the mentionned
error if i try to outprint directly the response object (it's not *
blocking* for me).
This is my test code (scala):
*//client is a transport client*
*val* suggestResponse = client.prepareSuggest("myIndex")
.addSuggestion(*new*CompletionSuggestionBuilder("test_case")
.field("tag")
.text("foo")
.size(10))
.execute().actionGet();
*//print suggest response to console*
println(suggestResponse) *// Suggest Response[Error: Can not write a
*while* (it.hasNext()) {
println(it.next().getText()) *// works fine print each expected
fields*
}
On Tuesday, September 10, 2013 9:17:28 PM UTC+4, Luca Cavanna wrote:
Could you please post the stacktrace of the error you get back? You
should see it in the elasticsearch log too.
Thanks
On Tuesday, September 10, 2013 10:56:30 AM UTC+2, LudoN4R4 wrote:
Hello,
I try to work with the new completion suggester (0.90.3) through java
API, but i get this error :
Suggest Response[Error: Can not write a field name, expecting a value]
This a sample code that i execute :
//client is a transport client
client.prepareSuggest("myIndex")
.addSuggestion(new CompletionSuggestionBuilder("")
.field("tag")
.text("foo")
.size(10))
.execute().actionGet();
If i use "prepareSearch" instead of "prepareSuggest" this work
correctly (searchs results+suggestions).
I could retrieve my "completions informations" but i've the mentionned
error if i try to outprint directly the response object (it's not *
blocking* for me).
This is my test code (scala):
*//client is a transport client*
*val* suggestResponse = client.prepareSuggest("myIndex")
.addSuggestion(*new*CompletionSuggestionBuilder("test_case")
.field("tag")
.text("foo")
.size(10))
.execute().actionGet();
*//print suggest response to console*
println(suggestResponse) *// Suggest Response[Error: Can not write a
*while* (it.hasNext()) {
println(it.next().getText()) *// works fine print each expected
fields*
}
On Tuesday, September 10, 2013 9:17:28 PM UTC+4, Luca Cavanna wrote:
Could you please post the stacktrace of the error you get back? You
should see it in the elasticsearch log too.
Thanks
On Tuesday, September 10, 2013 10:56:30 AM UTC+2, LudoN4R4 wrote:
Hello,
I try to work with the new completion suggester (0.90.3) through java
API, but i get this error :
Suggest Response[Error: Can not write a field name, expecting a value]
This a sample code that i execute :
//client is a transport client
client.prepareSuggest("myIndex")
.addSuggestion(new CompletionSuggestionBuilder("")
.field("tag")
.text("foo")
.size(10))
.execute().actionGet();
If i use "prepareSearch" instead of "prepareSuggest" this work
correctly (searchs results+suggestions).
On Wednesday, September 11, 2013 12:37:55 AM UTC+4, Luca Cavanna wrote:
Hi,
thanks to your reply I was able to understand where the problem was.
Nothing blocking, but still a bug in the SuggestResponse#toString method,
which was throwing that exception all the time.
I could retrieve my "completions informations" but i've the mentionned
error if i try to outprint directly the response object (it's not *
blocking* for me).
This is my test code (scala):
*//client is a transport client*
*val* suggestResponse = client.prepareSuggest("myIndex")
.addSuggestion(*new*CompletionSuggestionBuilder("test_case")
.field("tag")
.text("foo")
.size(10))
.execute().actionGet();
*//print suggest response to console*
println(suggestResponse) *// Suggest Response[Error: Can not write
*while* (it.hasNext()) {
println(it.next().getText()) *// works fine print each expected
fields*
}
On Tuesday, September 10, 2013 9:17:28 PM UTC+4, Luca Cavanna wrote:
Could you please post the stacktrace of the error you get back? You
should see it in the elasticsearch log too.
Thanks
On Tuesday, September 10, 2013 10:56:30 AM UTC+2, LudoN4R4 wrote:
Hello,
I try to work with the new completion suggester (0.90.3) through java
API, but i get this error :
Suggest Response[Error: Can not write a field name, expecting a value
]
This a sample code that i execute :
//client is a transport client
client.prepareSuggest("myIndex")
.addSuggestion(new CompletionSuggestionBuilder("")
.field("tag")
.text("foo")
.size(10))
.execute().actionGet();
If i use "prepareSearch" instead of "prepareSuggest" this work
correctly (searchs results+suggestions).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.