Advice on best approach to implement Compass component/reference idiom


(Jondow) #1

I'm trying to get my head around how to model the Compass component/
reference concept. Basically I have a whole bunch of Device objects
that are associated with many Software objects which are the result of
an audit done on a machine, and I want to be able to search for
Software objects, but get Device objects back as the results of my
search. With Compass, you'd make Software a component of Device and be
on your way.

What would be the best strategy to accomplish this with ES? Would I
need to do some form of custom mapping?

Regards,
Darryl


(Shay Banon) #2

You will simply need to create the json and represent it the way you want. Comparing the component mapping, then Software will be inner objects in the Device object. Use jackson to easily convert your domain model to json.
On Wednesday, May 4, 2011 at 10:53 AM, Jondow wrote:

I'm trying to get my head around how to model the Compass component/
reference concept. Basically I have a whole bunch of Device objects
that are associated with many Software objects which are the result of
an audit done on a machine, and I want to be able to search for
Software objects, but get Device objects back as the results of my
search. With Compass, you'd make Software a component of Device and be
on your way.

What would be the best strategy to accomplish this with ES? Would I
need to do some form of custom mapping?

Regards,
Darryl


(Jondow) #3

Thanks Shay.

So no custom mapping necessary. Defaults will suffice yeah?

On May 4, 10:13 am, Shay Banon shay.ba...@elasticsearch.com wrote:

You will simply need to create the json and represent it the way you want. Comparing the component mapping, then Software will be inner objects in the Device object. Use jackson to easily convert your domain model to json.

On Wednesday, May 4, 2011 at 10:53 AM, Jondow wrote:

I'm trying to get my head around how to model the Compass component/
reference concept. Basically I have a whole bunch of Device objects
that are associated with many Software objects which are the result of
an audit done on a machine, and I want to be able to search for
Software objects, but get Device objects back as the results of my
search. With Compass, you'd make Software a component of Device and be
on your way.

What would be the best strategy to accomplish this with ES? Would I
need to do some form of custom mapping?

Regards,
Darryl


(Shay Banon) #4

You mean using dynamic mappings in elasticsearch? Yes, assuming the defaults are good enough. They automatically handle inner (json) objects.
On Wednesday, May 4, 2011 at 11:46 AM, Jondow wrote:

Thanks Shay.

So no custom mapping necessary. Defaults will suffice yeah?

On May 4, 10:13 am, Shay Banon shay.ba...@elasticsearch.com wrote:

You will simply need to create the json and represent it the way you want. Comparing the component mapping, then Software will be inner objects in the Device object. Use jackson to easily convert your domain model to json.

On Wednesday, May 4, 2011 at 10:53 AM, Jondow wrote:

I'm trying to get my head around how to model the Compass component/
reference concept. Basically I have a whole bunch of Device objects
that are associated with many Software objects which are the result of
an audit done on a machine, and I want to be able to search for
Software objects, but get Device objects back as the results of my
search. With Compass, you'd make Software a component of Device and be
on your way.

What would be the best strategy to accomplish this with ES? Would I
need to do some form of custom mapping?

Regards,
Darryl


(system) #5