# Search and Indexing strategy

**URL:** <https://discuss.elastic.co/t/search-and-indexing-strategy/20935>\
**Category:** Elasticsearch\
**Created:** [November 25, 2014, 12:30pm UTC](https://discuss.elastic.co/t/search-and-indexing-strategy/20935 "2014-11-25T12:30:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshua\_harr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshua_harr/32/1082_2.png) [@joshua\_harr](https://discuss.elastic.co/u/joshua_harr)\
**Post date:** [November 25, 2014, 12:30pm UTC](https://discuss.elastic.co/t/search-and-indexing-strategy/20935/1 "2014-11-25T12:30:44Z")

</div>

Newbie here. This is probably straightforward, but I wanted to get  
best-practices recommendations if applicable.

My main ES use and query case is to search for a kind of Event. All Events  
are associated with (i.e. contain) a Country object. Besides querying for  
other kinds of Event data, queries can contain country-related data (e.g.  
name, location, continent, etc.). Since countries are a finite set and the  
country data is fairly large, I'd prefer not to duplicate country data  
across Event documents. What's the best way to handle this situation?

Best thing I can think of is to 1) create a separate index with the country  
data, then 2) run the user query against the country index 3) Pick off the  
high match(es) if any and 4) issue a new query against the Event index  
using something like the country abbreviation (from the high match) which  
would be an Event field. This seems like a lot of work per query. Is there  
a better solution?

TIA

--  
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/226e2b6b-7161-4cd4-a51f-6e62274b2483%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/226e2b6b-7161-4cd4-a51f-6e62274b2483%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 25, 2014, 8:54pm UTC](https://discuss.elastic.co/t/search-and-indexing-strategy/20935/2 "2014-11-25T20:54:18Z")

</div>

That seems like a lot of work for little data reduction, especially as ES  
compresses data as well.

Maybe someone else has an idea though.

On 25 November 2014 at 23:30, joshua harr [joshua.harr@gmail.com](mailto:joshua.harr@gmail.com) wrote:

> Newbie here. This is probably straightforward, but I wanted to get  
> best-practices recommendations if applicable.
> 
> My main ES use and query case is to search for a kind of Event. All Events  
> are associated with (i.e. contain) a Country object. Besides querying for  
> other kinds of Event data, queries can contain country-related data (e.g.  
> name, location, continent, etc.). Since countries are a finite set and the  
> country data is fairly large, I'd prefer not to duplicate country data  
> across Event documents. What's the best way to handle this situation?
> 
> Best thing I can think of is to 1) create a separate index with the  
> country data, then 2) run the user query against the country index 3) Pick  
> off the high match(es) if any and 4) issue a new query against the Event  
> index using something like the country abbreviation (from the high match)  
> which would be an Event field. This seems like a lot of work per query. Is  
> there a better solution?
> 
> TIA
> 
> --  
> 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/226e2b6b-7161-4cd4-a51f-6e62274b2483%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/226e2b6b-7161-4cd4-a51f-6e62274b2483%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/226e2b6b-7161-4cd4-a51f-6e62274b2483%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/226e2b6b-7161-4cd4-a51f-6e62274b2483%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAF3ZnZ%3DPbgW43taoBqGHxozh\_qCaP%3DNuWd%2Bf5GqZKbHk95F6dA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAF3ZnZ%3DPbgW43taoBqGHxozh_qCaP%3DNuWd%2Bf5GqZKbHk95F6dA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:47am UTC](https://discuss.elastic.co/t/search-and-indexing-strategy/20935/3 "2017-07-06T00:47:40Z")

</div>


