Query join cross types


(Petr Janský) #1

Hello guys,

I'm trying to find a way how to solve this case with two types:

"product" : {
"properties" : {
"kbi_id" : { "type" : "string", "index" : "not_analyzed"},
"agreement_status" : { "type" : "string", "index" :
"not_analyzed"}, - values Y/N
"product_code" : { "type" : "string", "index" : "not_analyzed"},
"date_valid" : { "type" : "string", format : "dd.MM.yyyy"}
}}
~120M records

"note" : {
"properties" : {
"note" : { "type" : "string", "analyzer" : "cestina_hunspell"},
"kbi_id" : { "type" : "string", "index" : "not_analyzed"},
"created_date" : {"type" : "date", format : "dd.MM.yyyy HH:mm:ss"},
}},
~3M records

The kbi_id field is clientID - join field. I don't have clients in my index.

I would like to get all note records for witch exist 1+ product record with
agreement_status="Y" and simultaneously 1+ product record with
agreement_status="N".

Any ideas?

Thx
Petr

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/4b217624-f542-4f7d-8493-fc7a93932e65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2