Find only those documents which do not contains id of some other nodes among results

Hi guys,

I just solved one problem and got into the other, but I hope this would be
a peace of cake for some of you with more experience with ES.
I have documents that look like this:
{
"_id":"document_A_id",
"title":"Document A",
...
"duplicates": []
}

{
"_id":"document_B_id",
"title":"Document B",
...
"duplicateof":
[
{"id":"document_A_id"},
{"id":"document_C_id"}
]
}

I'm using Java API to create a query which combines more like this text
query and different filters in order to select certain number of documents
with the highest score. In the given example document B is marked as
duplicate of document A, as it has a list "duplicateof" where id of
document A is stored. If these two documents are happened to be in the top
results I want to skip document B.

Does anybody have an idea how I can make this?

Thanks,
Zoran

--
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/7c4e5a84-acee-4653-8656-dc33db58549a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.