Parent child Query and highlighted result

I am new to search engine. I have started reading elasticsearch for almost
a month but I have not seen any example similar to the problem I am trying
to solve. Imagine I have in my mysql database a Case entity that has one
Employer entity , one Worker entity and many document entity

Case belongs to Worker
Case belongs to Employer
Case has_many Document

Worker has_many Cases

Employer has_many Cases

Document belongs_to Case

My entity is belows

  • Case ( number, year, description, employer_id, worker_id, documents)
  • Worker ( name, position, biography, email, phone)
  • Employer (name, country, note, email, phone)
  • document ( name, format, full_path)

For documents entity I use attachment type plugin to index it.

The cases is the most important part of my search . I want to search for
Cases with any field value in Case, Worker, Employer and Document and
result should be highlighted accordingly. For example

worker1 ( 'vicheka', 'Garment', 'Some biography', 'vicheka@email.com',
'855975553553' )
worker2 ( 'tola', 'Garment', 'Some biography', 'tola@email.com',
'855128374950' )
employer1 ( 'NGT group', 'Cambodia', 'some note', 'info@ngt.com',
'855975512445' )

case1( "001" , 2010, "Some description", worker1.id, employer1.id)
case2( "002" , 2010, "Some description", worker2.id, employer1.id)

document1 ('evident1.pdf', 'pdf', case1.id )
document2 ('evident2.docx', 'docx', case1.id )

document3 ('evident1.pdf', 'pdf', case2.id )
document4 ('evident2.docx', 'docx', case2.id )

When I type "info@ngt.com" the case1 should return :


Case : 001-2010 vicheka vs NGT group
From Employer :
Employer NGT group Cambodia 855975512445 info@ngt.com


Case : 002-2010 tola vs NGT group
From Employer :
Employer NGT group Cambodia 855975512445 info@ngt.com


I am not sure the best way to go with mapping to solve this problem.

Sorry for my bad english. Please feel free to clarify.

I highly appreciate for any help.

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