Completion suggester - java API - Suggest Response[Error: Can not write a field name, expecting a value]

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.

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.

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.

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 created an issue for this:
JsonGenerationException thrown in SuggestResponse#toString method · Issue #3661 · elastic/elasticsearch · GitHub . Just pushed a
fix as well, it will be in the next release.

Thanks for reporting this

Cheers
Luca

On Tue, Sep 10, 2013 at 8:59 PM, LudoN4R4 ludon454@gmail.com wrote:

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 *
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

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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/FwRv0D5qIi8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.

Hi,
thanks for the information you provided.
I was able to understand where the problem was. I created the following
issue: JsonGenerationException thrown in SuggestResponse#toString method · Issue #3661 · elastic/elasticsearch · GitHub , and I
pushed a fix, which will be available with next version.

Thanks for reporting this
Luca

On Tuesday, September 10, 2013 8:59:37 PM UTC+2, LudoN4R4 wrote:

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 *
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 

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.

Hi,

thanks for your reactivity.

Cordialement,
Ludo.

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 created an issue for this:
JsonGenerationException thrown in SuggestResponse#toString method · Issue #3661 · elastic/elasticsearch · GitHub . Just pushed
a fix as well, it will be in the next release.

Thanks for reporting this

Cheers
Luca

On Tue, Sep 10, 2013 at 8:59 PM, LudoN4R4 <ludo...@gmail.com <javascript:>

wrote:

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 *
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 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 a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/FwRv0D5qIi8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.