# Suggestion needed for handling renames

**URL:** <https://discuss.elastic.co/t/suggestion-needed-for-handling-renames/22321>\
**Category:** Elasticsearch\
**Created:** [February 23, 2015, 7:12am UTC](https://discuss.elastic.co/t/suggestion-needed-for-handling-renames/22321 "2015-02-23T07:12:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![satishmallik](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@satishmallik](https://discuss.elastic.co/u/satishmallik)\
**Post date:** [February 23, 2015, 7:12am UTC](https://discuss.elastic.co/t/suggestion-needed-for-handling-renames/22321/1 "2015-02-23T07:12:39Z")

</div>

I have following requirements,  
For every project that I index has 2 values

1. Id: Each project has a unique ID
2. Name: Name of the project. But Name of the project can change.

For every project, we index a document with different attributes. Say each  
document in index will have an Attribute A1 with different values. Each  
attribute has an Id and Name. Name again can change.

Oveall index would look like  
ProjectName ProjectGUID A1Name A1Id File  
P1 P1ID T1 T1-ID f11  
P1 P1ID T1 T1-ID f12  
P1 P1ID T1 T1-ID f13  
P1 P1ID T2 T2-ID f21  
.  
.

post rename of T2 to T3 index will look like,  
P1 P1ID T3 T2-ID f21

So Name has changed but not Id.

During query I aggregate on different attributes.

Problem:

1. User always queries with Project name.
2. During displaying results I want to display results based upon different  
attributes. Say for attribute A1 with name T1 3 documents exist. For T2 5  
documents exist.

If I index document with name query is very simple. But as we support  
renames, any rename means indexing whole project.  
So another option is to store ids in documents and store id to name map  
separately. For project rename we can use Alias with id as filter. For  
aggregations, one of the options I could see is term lookup filters. But I  
need to

1. read about aggregating on term lookup rather than term itself
2. cost associated with term lookup.

Are any other alternatives available with elasticsearch? I believe this  
should be a common problem. Any suggestions,

--  
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/460062d0-2e72-48f6-a4e7-08fc65e8c8e6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/460062d0-2e72-48f6-a4e7-08fc65e8c8e6%40googlegroups.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:30am UTC](https://discuss.elastic.co/t/suggestion-needed-for-handling-renames/22321/2 "2017-07-06T00:30:52Z")

</div>

Closed on July 6, 2017, 12:30am UTC


