Indexing nested documents

Perhaps I am missing something in the Java API, but how can I index a
nested document that is created from either another XContentBuilder or
other JSON creator such as Jackson?

From what I can tell, the value(...) methods do not support passing in
JSON/XContentBuilder. My current workaround is to convert the JSON into a
Map<String, Object). Is there a simpler solution?

Cheers,

Ivan

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

Hey Ivan,

without looking at the source and guessing wild at the early morning, what
about using bytes() method of the content builder? I think the value()
method can handle that...

--Alex

On Wed, May 1, 2013 at 2:14 AM, Ivan Brusic ivan@brusic.com wrote:

Perhaps I am missing something in the Java API, but how can I index a
nested document that is created from either another XContentBuilder or
other JSON creator such as Jackson?

From what I can tell, the value(...) methods do not support passing in
JSON/XContentBuilder. My current workaround is to convert the JSON into a
Map<String, Object). Is there a simpler solution?

Cheers,

Ivan

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

There are the rawField() methods for streaming an XContentBuilder into
another.

Jörg

Am 02.05.13 08:53, schrieb Alexander Reelsen:

Hey Ivan,

without looking at the source and guessing wild at the early morning,
what about using bytes() method of the content builder? I think the
value() method can handle that...

--Alex

On Wed, May 1, 2013 at 2:14 AM, Ivan Brusic <ivan@brusic.com
mailto:ivan@brusic.com> wrote:

Perhaps I am missing something in the Java API, but how can I
index a nested document that is created from either another
XContentBuilder or other JSON creator such as Jackson?

From what I can tell, the value(...) methods do not support
passing in JSON/XContentBuilder. My current workaround is to
convert the JSON into a Map<String, Object). Is there a simpler
solution?

Cheers,

Ivan

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

Alexander, I thought about that, but my assumption is that it would be
treated no differently than indexing a String.

Jörg, nested documents are not indexed under a new field, but as values
under an array. Need a rawValue() method.

Will explore the code more next week.

Ivan

On Wed, May 1, 2013 at 11:53 PM, Alexander Reelsen alr@spinscale.de wrote:

Hey Ivan,

without looking at the source and guessing wild at the early morning, what
about using bytes() method of the content builder? I think the value()
method can handle that...

--Alex

On Wed, May 1, 2013 at 2:14 AM, Ivan Brusic ivan@brusic.com wrote:

Perhaps I am missing something in the Java API, but how can I index a
nested document that is created from either another XContentBuilder or
other JSON creator such as Jackson?

From what I can tell, the value(...) methods do not support passing in
JSON/XContentBuilder. My current workaround is to convert the JSON into a
Map<String, Object). Is there a simpler solution?

Cheers,

Ivan

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

Back at work after being out last week. As predicted, neither indexing as
bytes nor rawField work with nested documents. Will continue using my
workaround of converting to a Map.

Surely I can't be the first one to index sub-builders.

--

Ivan

On Thu, May 2, 2013 at 8:48 AM, Ivan Brusic ivan@brusic.com wrote:

Alexander, I thought about that, but my assumption is that it would be
treated no differently than indexing a String.

Jörg, nested documents are not indexed under a new field, but as values
under an array. Need a rawValue() method.

Will explore the code more next week.

Ivan

On Wed, May 1, 2013 at 11:53 PM, Alexander Reelsen alr@spinscale.dewrote:

Hey Ivan,

without looking at the source and guessing wild at the early morning,
what about using bytes() method of the content builder? I think the value()
method can handle that...

--Alex

On Wed, May 1, 2013 at 2:14 AM, Ivan Brusic ivan@brusic.com wrote:

Perhaps I am missing something in the Java API, but how can I index a
nested document that is created from either another XContentBuilder or
other JSON creator such as Jackson?

From what I can tell, the value(...) methods do not support passing in
JSON/XContentBuilder. My current workaround is to convert the JSON into a
Map<String, Object). Is there a simpler solution?

Cheers,

Ivan

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