# Elasticsearch global search different filter on multiple indexes

**URL:** <https://discuss.elastic.co/t/elasticsearch-global-search-different-filter-on-multiple-indexes/15776>\
**Category:** Elasticsearch\
**Created:** [February 13, 2014, 11:40am UTC](https://discuss.elastic.co/t/elasticsearch-global-search-different-filter-on-multiple-indexes/15776 "2014-02-13T11:40:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakesh\_goyal](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@rakesh\_goyal](https://discuss.elastic.co/u/rakesh_goyal)\
**Post date:** [February 13, 2014, 11:40am UTC](https://discuss.elastic.co/t/elasticsearch-global-search-different-filter-on-multiple-indexes/15776/1 "2014-02-13T11:40:40Z")

</div>

We have got multiple indexes in elasticsearch and would like to search the  
data across all indexes but we want to apply different filters on different  
indexes. e.g.

- few indexes depends on client Id, hence client Id filter is required
- we have IS\_DELETED flag in few indexes, hence IS\_DELETED filter is  
required

What is the way to approach this in elasticsearch.

Also, we are using highlight feature of elasticsearch, which is supposed to  
give suggestions to the users but would like to ignore certain fields in  
the highlighted results. Is it possible to exclude certain fields at global  
level.

--  
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/7db38b10-f3db-457b-868a-ff02790ad8f0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7db38b10-f3db-457b-868a-ff02790ad8f0%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [February 13, 2014, 2:19pm UTC](https://discuss.elastic.co/t/elasticsearch-global-search-different-filter-on-multiple-indexes/15776/2 "2014-02-13T14:19:10Z")

</div>

It is possible to define multiple aliases (each with a different filter  
condition) and then search across aliases. Might help in your case.

[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html)

About highlighting, if you mean can you selectively highlight on specific  
fields, yes you can supply a list of fields that ES will perform the  
highlighting on. More details here:

[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html)

--  
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/230605ee-e178-4c24-9380-3976f73b095d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/230605ee-e178-4c24-9380-3976f73b095d%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![rakesh\_goyal](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@rakesh\_goyal](https://discuss.elastic.co/u/rakesh_goyal)\
**Post date:** [February 14, 2014, 9:43am UTC](https://discuss.elastic.co/t/elasticsearch-global-search-different-filter-on-multiple-indexes/15776/3 "2014-02-14T09:43:58Z")

</div>

Thanks for the prompt response. Aliases will surely help me in resolving  
filter issue across indexes but I didn't get how would I exclude certain  
fields globally from highlightling. Our requirement is to highlight all the  
fields except few fields.

On Thursday, 13 February 2014 19:49:10 UTC+5:30, Binh Ly wrote:

> It is possible to define multiple aliases (each with a different filter  
> condition) and then search across aliases. Might help in your case.
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html)
> 
> About highlighting, if you mean can you selectively highlight on specific  
> fields, yes you can supply a list of fields that ES will perform the  
> highlighting on. More details here:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html)

--  
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/a4f9db18-c12d-42cc-90ca-1bd1e0631e6c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a4f9db18-c12d-42cc-90ca-1bd1e0631e6c%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [February 14, 2014, 12:31pm UTC](https://discuss.elastic.co/t/elasticsearch-global-search-different-filter-on-multiple-indexes/15776/4 "2014-02-14T12:31:51Z")

</div>

I see, I didn't understand your original question. Unfortunately, you  
cannot say something like highlight all fields except field A, B, C. You  
can only list the fields you want highlighting on, and in addition you can  
use wildcards when specifying field names like for example:

{  
"\_source": false,  
"highlight": {  
"fields": {  
"ti\*": {  
"number\_of\_fragments": 0  
}  
}  
}  
}

--  
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/dc8a55b1-fbd4-431b-a808-c1bb6e2110a1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/dc8a55b1-fbd4-431b-a808-c1bb6e2110a1%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:50am UTC](https://discuss.elastic.co/t/elasticsearch-global-search-different-filter-on-multiple-indexes/15776/5 "2017-07-06T01:50:10Z")

</div>


