# Storing K/V configuration in elasticsearch

**URL:** <https://discuss.elastic.co/t/storing-k-v-configuration-in-elasticsearch/16073>\
**Category:** Elasticsearch\
**Created:** [February 28, 2014, 3:51pm UTC](https://discuss.elastic.co/t/storing-k-v-configuration-in-elasticsearch/16073 "2014-02-28T15:51:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Caoilte\_O\_Connor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/caoilte_o_connor/32/1762_2.png) [@Caoilte\_O\_Connor](https://discuss.elastic.co/u/Caoilte_O_Connor)\
**Post date:** [February 28, 2014, 3:51pm UTC](https://discuss.elastic.co/t/storing-k-v-configuration-in-elasticsearch/16073/1 "2014-02-28T15:51:25Z")

</div>

Hi,  
Quick, silly question. I want to control switching over from searching on  
one field to another using a configuration property. Since the  
configuration property is set and used by two applications that only use  
elasticsearch, need to be able to update it regularly and to have it  
persist, it seems to make most sense to store the configuration property in  
Elasticsearch along with the data it refers to.

Is there a better way of doing this than simply setting up a new index with  
one document and one field on it?

Is there an existing admin index that it would make sense for me to set the  
property in?

Thanks

Caoilte

--  
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/ab98af94-7274-48b6-ad8c-9c3faa226090%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ab98af94-7274-48b6-ad8c-9c3faa226090%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\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)\
**Post date:** [February 28, 2014, 9:13pm UTC](https://discuss.elastic.co/t/storing-k-v-configuration-in-elasticsearch/16073/2 "2014-02-28T21:13:35Z")

</div>

If you're asking if there is a way to use a field name in your query say  
"field1", and then have it actually look at another field say "fieldxyz" or  
"fieldabc" at query time, no there is no such capability. The best way to  
do this is probably in some kind of configuration that is part of your  
application. You certainly can store this information in a document in ES,  
but you still have to query it in your application startup and then adjust  
your queries yourself in code dynamically.

--  
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/1cf6df3b-2d2d-49c8-bcf0-0b5f68c03a98%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1cf6df3b-2d2d-49c8-bcf0-0b5f68c03a98%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:46am UTC](https://discuss.elastic.co/t/storing-k-v-configuration-in-elasticsearch/16073/3 "2017-07-06T01:46:28Z")

</div>


