Sorry Luca but there are no stacktrace. I've noted that this error is not
due to the request himself but "just" to the "toString" method fromSuggestResponsehttps://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/suggest/SuggestResponse.java(which catch the error and pretty print it)
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
field name, expecting a value]*
*// Get completion values*
*val* it =
suggestResponse.getSuggest().iterator().next().getEntries().get(0).iterator()
*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).Thanks in advance,
ludo.
--
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.
For more options, visit https://groups.google.com/groups/opt_out.