Questions on completion suggestor


(Amit Soni) #1

Hi all - I have been trying to save documents in elastic search and one of
the fields in my schema is of type "completion."
In this article http://www.elasticsearch.org/blog/you-complete-me/, I see
the json request to save the document. I am using Java client and I am
unable to find a right Java API which I can use to save the data for the
"completion" type field. Can you pl point me to the right java API?

Just to summary, pl let me know the java counter part for how I can index
the part below in blue.

curl -X PUT localhost:9200/hotels/hotel/3 -d '
{
"name" : "Courtyard by Marriot Munich City",

"city" : "Munich",
"name_suggest" : {

"input" :      [
  "Courtyard by Marriot Munich City",

  "Marriot Munich City"
],
"output":      "Hotel Marriot",

"weight":      15,
"payload":     { "hotel_id": 3}

}
}'

-Amit.

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


(David Pilato) #2

It's the same API you use to index regular documents.

How do you build your docs in Java?
Jackson? XContent helpers? String concatenation?

HTH

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 1 nov. 2013 à 02:27, Amit Soni amitsoni29@gmail.com a écrit :

Hi all - I have been trying to save documents in elastic search and one of the fields in my schema is of type "completion."
In this article, I see the json request to save the document. I am using Java client and I am unable to find a right Java API which I can use to save the data for the "completion" type field. Can you pl point me to the right java API?

Just to summary, pl let me know the java counter part for how I can index the part below in blue.
curl -X PUT localhost:9200/hotels/hotel/3 -d '

{
"name" : "Courtyard by Marriot Munich City",

"city" : "Munich",
"name_suggest" : {

"input" :      [
  "Courtyard by Marriot Munich City",


  "Marriot Munich City"
],
"output":      "Hotel Marriot",


"weight":      15,
"payload":     { "hotel_id": 3}

}
}'

-Amit.

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.

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


(Amit Soni) #3

Hi David - I have been using jackson. Okay, so I can create some more POJOs
(which conform to the above json for storing this special field) and then
use them to save the document via jackson. Right?

-Amit.

On Thu, Oct 31, 2013 at 8:11 PM, David Pilato david@pilato.fr wrote:

It's the same API you use to index regular documents.

How do you build your docs in Java?
Jackson? XContent helpers? String concatenation?

HTH

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 1 nov. 2013 à 02:27, Amit Soni amitsoni29@gmail.com a écrit :

Hi all - I have been trying to save documents in elastic search and one of
the fields in my schema is of type "completion."
In this article http://www.elasticsearch.org/blog/you-complete-me/, I
see the json request to save the document. I am using Java client and I am
unable to find a right Java API which I can use to save the data for the
"completion" type field. Can you pl point me to the right java API?

Just to summary, pl let me know the java counter part for how I can index
the part below in blue.

curl -X PUT localhost:9200/hotels/hotel/3 -d '

{
"name" : "Courtyard by Marriot Munich City",

"city" : "Munich",
"name_suggest" : {

"input" :      [
  "Courtyard by Marriot Munich City",


  "Marriot Munich City"
],
"output":      "Hotel Marriot",



"weight":      15,
"payload":     { "hotel_id": 3}

}
}'

-Amit.

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

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

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


(David Pilato) #4

Yeah. I guess so.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 1 nov. 2013 à 04:31, Amit Soni amitsoni29@gmail.com a écrit :

Hi David - I have been using jackson. Okay, so I can create some more POJOs (which conform to the above json for storing this special field) and then use them to save the document via jackson. Right?

-Amit.

On Thu, Oct 31, 2013 at 8:11 PM, David Pilato david@pilato.fr wrote:

It's the same API you use to index regular documents.

How do you build your docs in Java?
Jackson? XContent helpers? String concatenation?

HTH

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 1 nov. 2013 à 02:27, Amit Soni amitsoni29@gmail.com a écrit :

Hi all - I have been trying to save documents in elastic search and one of the fields in my schema is of type "completion."
In this article, I see the json request to save the document. I am using Java client and I am unable to find a right Java API which I can use to save the data for the "completion" type field. Can you pl point me to the right java API?

Just to summary, pl let me know the java counter part for how I can index the part below in blue.
curl -X PUT localhost:9200/hotels/hotel/3 -d '

{
"name" : "Courtyard by Marriot Munich City",

"city" : "Munich",
"name_suggest" : {

"input" :      [
  "Courtyard by Marriot Munich City",


  "Marriot Munich City"
],
"output":      "Hotel Marriot",




"weight":      15,
"payload":     { "hotel_id": 3}

}
}'

-Amit.

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.

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

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

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


(system) #5