# Enforce no match if term in search is duplicated

**URL:** <https://discuss.elastic.co/t/enforce-no-match-if-term-in-search-is-duplicated/90612>\
**Category:** Elasticsearch\
**Created:** [June 23, 2017, 10:06am UTC](https://discuss.elastic.co/t/enforce-no-match-if-term-in-search-is-duplicated/90612 "2017-06-23T10:06:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Borsodi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_borsodi/32/19290_2.png) [@David\_Borsodi](https://discuss.elastic.co/u/David_Borsodi)\
**Post date:** [June 23, 2017, 10:06am UTC](https://discuss.elastic.co/t/enforce-no-match-if-term-in-search-is-duplicated/90612/1 "2017-06-23T10:06:19Z")

</div>

I noticed that if I replicate a term in the search expression, the relevance of documents containing it only once will increase. Though my expected behavior is to omit them from the results.

Eg  
doc 1 :Fred Fredrickson  
doc2: Fred Waters

search term: fred fred  
I want doc1 but not doc2.

How to achieve this? My index is standard+ngrams and I use AND operatior for ngrams macthing and bool+must for full word matching

---

<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:** [July 21, 2017, 10:06am UTC](https://discuss.elastic.co/t/enforce-no-match-if-term-in-search-is-duplicated/90612/2 "2017-07-21T10:06:37Z")

</div>

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