# Multi match with different slops and with multi filters search use case

**URL:** <https://discuss.elastic.co/t/multi-match-with-different-slops-and-with-multi-filters-search-use-case/83185>\
**Category:** Elasticsearch\
**Created:** [April 21, 2017, 9:32am UTC](https://discuss.elastic.co/t/multi-match-with-different-slops-and-with-multi-filters-search-use-case/83185 "2017-04-21T09:32:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SKumarMN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/skumarmn/32/27537_2.png) [@SKumarMN](https://discuss.elastic.co/u/SKumarMN)\
**Post date:** [April 21, 2017, 9:32am UTC](https://discuss.elastic.co/t/multi-match-with-different-slops-and-with-multi-filters-search-use-case/83185/1 "2017-04-21T09:32:36Z")

</div>

Hi All,

I have a use case where i need to search for a phrase(with different slops) either in title or content(body) of the document and also add filters for the above search case. With the below query, I get documents even with **score 0( non matching documents)**. Can you please help me where am I going wrong

Query:

```
> {
> "size":5,
> "fields":[
> "title",
> "product",
> "url",
> "subject"
> ],
> "query":{
> "bool":{
> "filter":[
> {
> "terms":{
> "product":[
> "Books"
> ]
> }
> },
> {
> "terms":{
> "subject":[
> "About This Help"
> ]
> }
> }
> ],
> "should":[
> {
> "match_phrase_prefix":{
> "title.autocomp":{
> "query":"cro",
> "boost":5,
> "slop":3
> }
> }
> },
> {
> "match_phrase_prefix":{
> "content.autocomp":{
> "query":"cro",
> "boost":2,
> "slop":10
> }
> }
> }
> ]
> }
> },
> "highlight":{
> "pre_tags":[
> "<b>"
> ],
> "post_tags":[
> "</b>"
> ],
> "fields":{
> "content.autocomp":{

> },
> "title.autocomp":{

> }
> }
> }
> }

```

Results:

```
> {
> "took": 12,
> "timed_out": false,
> "_shards": {
> "total": 5,
> "successful": 5,
> "failed": 0
> },
> "hits": {
> "total": 15,
> "max_score": 0.062365085,
> "hits": [
> {
> "_index": "psbooks",
> "_type": "topic",
> "_id": "aHR0cDovL3NsYzA2d2xpLnVzLm9yYWNsZS5jb20vd2VidGVzdC9vdXQ4NTUvY3NfMTE3MDc2MTE0NGgyL3dlYi9oZWxwLVBCL2VuZy9jcy9hdHBiL3Rhc2tfRGlzYWJsaW5nRGVsaXZlcmVkUHJvZHVjdHNPclN1YmplY3RzLmh0bWw=",
> "_score": 0.062365085,
> "fields": {
> "product": [
> "Books"
> ],
> "title": [
> "Disabling Delivered Products or Subjects"
> ],
> "url": [
> "http://internal.com/webtest/out855/cs_1170761144h2/web/help-PB/eng/cs/atpb/task_DisablingDeliveredProductsOrSubjects.html"
> ],
> "subject": [
> "About This Help"
> ]
> },
> "highlight": {
> "content.autocomp": [
> " remove destinations for the tupa subject folder. The removed destinations have been <b>crossed</b> out to show"
> ]
> }
> },
> {
> "_index": "psbooks",
> "_type": "topic",
> "_id": "aHR0cDovL3NsYzA2d2xpLnVzLm9yYWNsZS5jb20vd2VidGVzdC9vdXQ4NTUvY3NfMTE3MDc2MTE0NGgyL3dlYi9oZWxwLVBCL2VuZy9jcy9hdHBiL3Rhc2tfU2VhcmNoaW5nQUxvY2FsbHlJbnN0YWxsZWRQZW9wbGVTb2Z0T25saW5lSGVscFdlYnNpdGUuaHRtbA==",
> "_score": 0,
> "fields": {
> "product": [
> "Books"
> ],
> "title": [
> "Searching a Locally Installed PeopleSoft Online Help Website"
> ],
> "url": [
> "http://internal.com/webtest/out855/cs_1170761144h2/web/help-PB/eng/cs/atpb/task_SearchingALocallyInstalledPeopleSoftOnlineHelpWebsite.html"
> ],
> "subject": [
> "About This Help"
> ]
> }
> },
> {
> "_index": "psbooks",
> "_type": "topic",
> "_id": "aHR0cDovL3NsYzA2d2xpLnVzLm9yYWNsZS5jb20vd2VidGVzdC9vdXQ4NTUvY3NfMTE3MDc2MTE0NGgyL3dlYi9oZWxwLVBCL2VuZy9jcy9hdHBiL3Rhc2tfQWRkaW5nQXR0cmlidXRlRmlsdGVyc0ZvclNlYXJjaFJlc3VsdHMuaHRtbA==",
> "_score": 0,
> "fields": {
> "product": [
> "Books"
> ],
> "title": [
> "Adding Attribute Filters for Search Results"
> ],
> "url": [
> "http://internal.com/webtest/out855/cs_1170761144h2/web/help-PB/eng/cs/atpb/task_AddingAttributeFiltersForSearchResults.html"
> ],
> "subject": [
> "About This Help"
> ]
> }
> },
> {
> "_index": "psbooks",
> "_type": "topic",
> "_id": "aHR0cDovL3NsYzA2d2xpLnVzLm9yYWNsZS5jb20vd2VidGVzdC9vdXQ4NTUvY3NfMTE3MDc2MTE0NGgyL3dlYi9oZWxwLVBCL2VuZy9jcy9hdHBiL3Rhc2tfQWNjZXNzaW5nVGhlUGVvcGxlU29mdE9ubGluZUhlbHBBbmRQZW9wbGVCb29rcy5odG1s",
> "_score": 0,
> "fields": {
> "product": [
> "Books"
> ],
> "title": [
> "Accessing the PeopleSoft Online Help and PeopleBooks"
> ],
> "url": [
> "http://internal.com/webtest/out855/cs_1170761144h2/web/help-PB/eng/cs/atpb/task_AccessingThePeopleSoftOnlineHelpAndPeopleBooks.html"
> ],
> "subject": [
> "About This Help"
> ]
> }
> },
> {
> "_index": "psbooks",
> "_type": "topic",
> "_id": "aHR0cDovL3NsYzA2d2xpLnVzLm9yYWNsZS5jb20vd2VidGVzdC9vdXQ4NTUvY3NfMTE3MDc2MTE0NGgyL3dlYi9oZWxwLVBCL2VuZy9jcy9hdHBiL2NvbmNlcHRfVW5kZXJzdGFuZGluZ0hlbHBDb250ZW50TWFuYWdlbWVudC5odG1s",
> "_score": 0,
> "fields": {
> "product": [
> "Books"
> ],
> "title": [
> "Understanding Help Content Management"
> ],
> "url": [
> "http://internal.com/webtest/out855/cs_1170761144h2/web/help-PB/eng/cs/atpb/concept_UnderstandingHelpContentManagement.html"
> ],
> "subject": [
> "About This Help"
> ]
> }
> }
> ]
> }
> }
```

---

<div class="post-metadata">

**Author:** ![SKumarMN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/skumarmn/32/27537_2.png) [@SKumarMN](https://discuss.elastic.co/u/SKumarMN)\
**Post date:** [April 22, 2017, 1:57pm UTC](https://discuss.elastic.co/t/multi-match-with-different-slops-and-with-multi-filters-search-use-case/83185/2 "2017-04-22T13:57:33Z")

</div>

Can anyone please advice/guide

---

<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:** [May 20, 2017, 1:59pm UTC](https://discuss.elastic.co/t/multi-match-with-different-slops-and-with-multi-filters-search-use-case/83185/3 "2017-05-20T13:59:08Z")

</div>

Closed on May 20, 2017, 1:59pm UTC

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