Hello, I have a requirement we need to implement and I really don´t know
how to do it or even if it is possible (maybe the solution is easy but I
just don´t know).
We have Person documents like this:
{
"id": 1,
"name": "Ernesto",
"NID": "AAA"
}
{
"id": 2,
"name": "Enrique",
"NID": "AAA"
}
{
"id": 3,
"name": "Antonio",
"NID": "BBB"
}
{
"id": 4,
"name": "Karlos",
"NID": "CCC"
}
Imagine we search for Persons with ["NID": "AAA"], we would get 2 documents
(id 1 and id 2).
If we search for Persons with ["NID": "BBB"], we would get 1 document (id
3).
And if we search for Persons with ["NID": "CCC"], we would get 1 document
(id 3).
Ok, so what we need is get all the documents in which the NID is unique. I
mean, the _count would be only 1 if we search for the NID of those
documents. The results from that query/filter would be documents 3 and 4,
since the NID value is unique for those documents (there are no more
documents in the index with that NID).
Thank you very much,
Ernesto
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/977fa0d9-1b88-4147-8073-dd4d29aff1a6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.