# Query that Gives priority to different indexes

**URL:** <https://discuss.elastic.co/t/query-that-gives-priority-to-different-indexes/143194>\
**Category:** Elasticsearch\
**Created:** [August 6, 2018, 4:37pm UTC](https://discuss.elastic.co/t/query-that-gives-priority-to-different-indexes/143194 "2018-08-06T16:37:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![net](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@net](https://discuss.elastic.co/u/net)\
**Post date:** [August 6, 2018, 4:37pm UTC](https://discuss.elastic.co/t/query-that-gives-priority-to-different-indexes/143194/1 "2018-08-06T16:37:35Z")

</div>

I have four indexes: A, B, C, D

Each index has a term field named "Word"

i.e.

Index A

```
{
  "mappings": {
    "doc": { 
      "properties": { 
        "word": {
        	"type": "keyword"
        }
      }
    }
  }
}

```

Index B:

```
{
  "mappings": {
    "doc": { 
      "properties": { 
        "word": {
        	"type": "keyword"
        }
      }
    }
  }
}

```

Index C:

```
{
  "mappings": {
    "doc": { 
      "properties": { 
        "word": {
        	"type": "keyword"
        }
      }
    }
  }

```

}

Index D:

```
{
  "mappings": {
    "doc": { 
      "properties": { 
        "word": {
        	"type": "keyword"
        }
      }
    }
  }
}

```

I'd like to create a query that does the following:

Give order of priority:

1. A and B words gets top priority
2. Only C words that do not appear in A words (no repeated words)
3. Only D words that do not appear in A words (no repeated words)

Is this possible?

---

<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 3, 2018, 4:37pm UTC](https://discuss.elastic.co/t/query-that-gives-priority-to-different-indexes/143194/2 "2018-09-03T16:37:39Z")

</div>

Closed on September 3, 2018, 4:37pm UTC

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