Elasticsearch how to prevent duplicate data?


(mahmoud samy ) #1

Hi all,

I need to prevent documents to be inserted into single index if it has the same data

EX:

{
    "_score":1.0,
    "_source":{
        "value":{
            "user":"test user",
            "age":"20"
        }
}

I need top prevent any documents has the same user and age into the same index

(David Pilato) #2

You should compute a fingerprint based on content and use this fingerprint as the document id.


(Christian Dahlqvist) #3

Have a look at these blog posts: