# Find Duplicate candidates (similar) articles

**URL:** <https://discuss.elastic.co/t/find-duplicate-candidates-similar-articles/98790>\
**Category:** Elasticsearch\
**Created:** [August 30, 2017, 5:40am UTC](https://discuss.elastic.co/t/find-duplicate-candidates-similar-articles/98790 "2017-08-30T05:40:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yusef-sheypoor](https://avatars.discourse-cdn.com/v4/letter/y/e5b9ba/32.png) [@yusef-sheypoor](https://discuss.elastic.co/u/yusef-sheypoor)\
**Post date:** [August 30, 2017, 5:40am UTC](https://discuss.elastic.co/t/find-duplicate-candidates-similar-articles/98790/1 "2017-08-30T05:40:43Z")

</div>

We have a websites which users can post Content to website and after moderation check Contents they published,_Title_ and _Description_ are the most important field that content, we want to prevent users to publish similar posts So we looking for implement a method to find similar post and hint the moderation these content are very similar to some old posts and moderator check them carefully for duplication, I mean warn moderation them as Suspicious duplicates, we index all content in Elastic search and my question about the optimum query we have to write.  
This is part of code we tried but

```
    $nameDesc = $title->Title. ' ' . $item->Description;

    $query = [
        '_source' => ['name', 'description', 'price'],
        'query' => [
            'filtered' => [
                'query' => [
                    'multi_match' => [
                        'fields' => ['title', 'description'],
                        'type' => 'cross_fields',
                        'query' => $nameDesc
                    ]
                ],
                'filter' => [
                    'not' => [
                        'ids' => ['values' => [$item->ID]]
                    ]
                ],
            ],
        ]
    ];
    $dupeCandidates = $this->indexService->buildSearch('articles', $query)->setLimit(4)->get();

```

I suppose it's better instead of concat _Title_ and _Description_ and do cross\_fields multi match, try two separate match query, or better solution.

**In concise We're looking for optimum query detect high similar content by Title and Description in Elasticsearch**.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 27, 2017, 5:41am UTC](https://discuss.elastic.co/t/find-duplicate-candidates-similar-articles/98790/2 "2017-09-27T05:41:00Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
