# Exact search doesn't work as expected

**URL:** <https://discuss.elastic.co/t/exact-search-doesnt-work-as-expected/21024>\
**Category:** Elasticsearch\
**Created:** [December 2, 2014, 9:52am UTC](https://discuss.elastic.co/t/exact-search-doesnt-work-as-expected/21024 "2014-12-02T09:52:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergey\_Berkovich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergey_berkovich/32/17925_2.png) [@Sergey\_Berkovich](https://discuss.elastic.co/u/Sergey_Berkovich)\
**Post date:** [December 2, 2014, 9:52am UTC](https://discuss.elastic.co/t/exact-search-doesnt-work-as-expected/21024/1 "2014-12-02T09:52:35Z")

</div>

Hi all,  
I wonder if anyone knows how to solve this one: I'm trying to mimic Linux  
"grep" command behavior in Elastic Search.

_The problem:_  
Sending search request for "hello world" should first return all matches  
where these two words come together in a sentence. However, internal  
Elastic Search ranking kicks off instead, returning matches with high  
appearances of "hello" or "world" words.

_Current configuration:_  
I'm indexing file contents using the attachments plug in from  
[https://github.com/elasticsearch/elasticsearch-mapper-attachments](https://github.com/elasticsearch/elasticsearch-mapper-attachments) (mappings  
attached).  
I was suspecting analyzer breaking the original file structure, so I tried  
to disable it by using { "index": "not analyzed" }, but it didn't help.

Appreciate any advice you can come up with 🙂

Thanks,  
Sergey.

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c416237c-ddc9-4d15-be60-e904af46ac57%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c416237c-ddc9-4d15-be60-e904af46ac57%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:46am UTC](https://discuss.elastic.co/t/exact-search-doesnt-work-as-expected/21024/2 "2017-07-06T00:46:40Z")

</div>

Closed on July 6, 2017, 12:46am UTC


