# Highlighting across different indices

**URL:** <https://discuss.elastic.co/t/highlighting-across-different-indices/13703>\
**Category:** Elasticsearch\
**Created:** [September 20, 2013, 1:33pm UTC](https://discuss.elastic.co/t/highlighting-across-different-indices/13703 "2013-09-20T13:33:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bibin\_Abraham](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@Bibin\_Abraham](https://discuss.elastic.co/u/Bibin_Abraham)\
**Post date:** [September 20, 2013, 1:33pm UTC](https://discuss.elastic.co/t/highlighting-across-different-indices/13703/1 "2013-09-20T13:33:56Z")

</div>

Say I have two indices:  
facebook \> post \> user , message  
twitter \> post \> user , message

Now I search across these two indices. How can I highlight words from  
twitter\>post\>message alone and not facebook\>post\>message

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Bibin\_Abraham](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@Bibin\_Abraham](https://discuss.elastic.co/u/Bibin_Abraham)\
**Post date:** [September 23, 2013, 6:29am UTC](https://discuss.elastic.co/t/highlighting-across-different-indices/13703/2 "2013-09-23T06:29:13Z")

</div>

Will multi-search solve the above issue?

On Friday, 20 September 2013 19:03:56 UTC+5:30, bin wrote:

> Say I have two indices:  
> facebook \> post \> user , message  
> twitter \> post \> user , message
> 
> Now I search across these two indices. How can I highlight words from  
> twitter\>post\>message alone and not facebook\>post\>message

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [September 23, 2013, 3:28pm UTC](https://discuss.elastic.co/t/highlighting-across-different-indices/13703/3 "2013-09-23T15:28:19Z")

</div>

Hi,

On Mon, Sep 23, 2013 at 8:29 AM, bin [bibin.abraham.dev@gmail.com](mailto:bibin.abraham.dev@gmail.com) wrote:

> Will multi-search solve the above issue?

Multi-search would indeed allow for not highlighting twitter messages, but  
the result sets will be disjoint. Multi-search is just a convenient way to  
run several search requests in a single HTTP request.

> On Friday, 20 September 2013 19:03:56 UTC+5:30, bin wrote:
> 
> > Say I have two indices:  
> > facebook \> post \> user , message  
> > twitter \> post \> user , message
> > 
> > Now I search across these two indices. How can I highlight words from  
> > twitter\>post\>message alone and not facebook\>post\>message

This is not a common requirement. I guess the only way to do so would be to  
have different field names for the messages on your facebook and twitter  
indices. But this would also make your query more complicated...

--  
Adrien Grand

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Bibin\_Abraham](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@Bibin\_Abraham](https://discuss.elastic.co/u/Bibin_Abraham)\
**Post date:** [September 23, 2013, 6:05pm UTC](https://discuss.elastic.co/t/highlighting-across-different-indices/13703/4 "2013-09-23T18:05:32Z")

</div>

Thanks Adrien for your help. Our app has ~10 entities. I thought of adding  
each entity as an index with its sub-entities as its types rather than app  
as an index. And further using organization\_id as a routing value across  
all indices. Since some entities are having common fields like name,  
date,.., I needed more control over the highlighting fields. That is the  
reason I asked for this question. Thanks once again.

On Monday, 23 September 2013 20:58:19 UTC+5:30, Adrien Grand wrote:

> Hi,
> 
> On Mon, Sep 23, 2013 at 8:29 AM, bin \<[bibin.ab...@gmail.com](mailto:bibin.ab...@gmail.com) \<javascript:\>\>wrote:
> 
> > Will multi-search solve the above issue?
> 
> Multi-search would indeed allow for not highlighting twitter messages, but  
> the result sets will be disjoint. Multi-search is just a convenient way to  
> run several search requests in a single HTTP request.
> 
> > On Friday, 20 September 2013 19:03:56 UTC+5:30, bin wrote:
> > 
> > > Say I have two indices:  
> > > facebook \> post \> user , message  
> > > twitter \> post \> user , message
> > > 
> > > Now I search across these two indices. How can I highlight words from  
> > > twitter\>post\>message alone and not facebook\>post\>message
> 
> This is not a common requirement. I guess the only way to do so would be  
> to have different field names for the messages on your facebook and twitter  
> indices. But this would also make your query more complicated...
> 
> --  
> Adrien Grand

--  
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).  
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, 2:15am UTC](https://discuss.elastic.co/t/highlighting-across-different-indices/13703/5 "2017-07-06T02:15:04Z")

</div>


