Support for indexing

Hi chaps,

I'm currently thinking about indexing a Client File. The DB contains
various things, structured the following way :

  • clients owning contracts,
  • events occurring on those contracts.

the searches I wish to execute are :

  • Find a client, its contracts and the events on this contract
  • Find a contract, and its events (an a link to the owner)
  • Find an event (and a link to the contract involved).

How should I map this structure ? Should I use nested docs ?

Thanks for your help.

Regards,
Yann

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

Hello Yann,

Yes, you can use nested docs, or you can break clients, contracts and
events into different types and make clients the _parent of contracts, and
contracts _parent of events.

This would let you index and update different documents independently, as
opposed to nested documents where you have to reindex the whole structured.
But there are disdvantages on the search side: has_child query is slower
than the equivalent nested query, and you'd have to hit ES again to get the
child.

Best regards,
Radu

http://sematext.com/ -- Elasticsearch -- Solr -- Lucene

On Thu, Feb 14, 2013 at 11:59 AM, Yann Barraud yann.barraud@gmail.comwrote:

Hi chaps,

I'm currently thinking about indexing a Client File. The DB contains
various things, structured the following way :

  • clients owning contracts,
  • events occurring on those contracts.

the searches I wish to execute are :

  • Find a client, its contracts and the events on this contract
  • Find a contract, and its events (an a link to the owner)
  • Find an event (and a link to the contract involved).

How should I map this structure ? Should I use nested docs ?

Thanks for your help.

Regards,
Yann

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

Hi Radu,

Thanks for this answer. I'll investigate the 2 options, depending on how we
want to search items.

Kind regards,
Yann

Le dimanche 17 février 2013 13:14:55 UTC+1, Radu Gheorghe a écrit :

Hello Yann,

Yes, you can use nested docs, or you can break clients, contracts and
events into different types and make clients the _parent of contracts, and
contracts _parent of events.

This would let you index and update different documents independently, as
opposed to nested documents where you have to reindex the whole structured.
But there are disdvantages on the search side: has_child query is slower
than the equivalent nested query, and you'd have to hit ES again to get the
child.

Best regards,
Radu

http://sematext.com/ -- Elasticsearch -- Solr -- Lucene

On Thu, Feb 14, 2013 at 11:59 AM, Yann Barraud <yann.b...@gmail.com<javascript:>

wrote:

Hi chaps,

I'm currently thinking about indexing a Client File. The DB contains
various things, structured the following way :

  • clients owning contracts,
  • events occurring on those contracts.

the searches I wish to execute are :

  • Find a client, its contracts and the events on this contract
  • Find a contract, and its events (an a link to the owner)
  • Find an event (and a link to the contract involved).

How should I map this structure ? Should I use nested docs ?

Thanks for your help.

Regards,
Yann

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