# Strange behavior: some words breaks search

**URL:** <https://discuss.elastic.co/t/strange-behavior-some-words-breaks-search/68226>\
**Category:** Elasticsearch\
**Created:** [December 6, 2016, 11:47pm UTC](https://discuss.elastic.co/t/strange-behavior-some-words-breaks-search/68226 "2016-12-06T23:47:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joomler](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Joomler](https://discuss.elastic.co/u/Joomler)\
**Post date:** [December 6, 2016, 11:47pm UTC](https://discuss.elastic.co/t/strange-behavior-some-words-breaks-search/68226/1 "2016-12-06T23:47:46Z")

</div>

I am using [http://elasticsearch-dsl.readthedocs.io](http://elasticsearch-dsl.readthedocs.io)

Faced a strange behavior during search: some words that I pass to "should" query breaks search - search cannot find that words (I see that in console) - but also a lot of other words too.  
In code below "should" query consist of 1000 clauses.  
My guess was that this word is not in vocabulary (I use russian and english morphology config) - but no, with other unseen and special words search is good.  
So, when i remove these "problem" words search is working again.

```
for i in eat_search_raw_list_1024:
    q = Q('bool',
        #must=[Q('match', text='BBQ')],
        should=[(Q("match", text="\'bad service\'~3") | Q("match", text="\'bad eat\'~3") .........1000 more................],
        minimum_should_match=1, 
        _name=name_query 
    )            
    s = Search(using=client, index="haystack").query(q).query(~Q("match", text=minus_words))    
    s = s.highlight('text', fragment_size=50)  
    response = s.execute()
```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 7, 2016, 1:17pm UTC](https://discuss.elastic.co/t/strange-behavior-some-words-breaks-search/68226/2 "2016-12-07T13:17:40Z")

</div>

Hey,

as you are trying to execute a `match` query, but you are using the syntax of the `query_string` query inside of the `text`, no documents might be found.

Have you tried this with only a single match query, to see if anything is matched at all?

--Alex

---

<div class="post-metadata">

**Author:** ![Joomler](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Joomler](https://discuss.elastic.co/u/Joomler)\
**Post date:** [December 7, 2016, 2:28pm UTC](https://discuss.elastic.co/t/strange-behavior-some-words-breaks-search/68226/3 "2016-12-07T14:28:33Z")

</div>

Hm, yes you are right that this is `query_string` query but this is working part of code - it finds some expected posts. It stop working only with some words combinations

---

<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:** [January 4, 2017, 2:28pm UTC](https://discuss.elastic.co/t/strange-behavior-some-words-breaks-search/68226/4 "2017-01-04T14:28:46Z")

</div>

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