I have a set of data which are simply key value pairs, of type string.
eg:
key : Name1, Value : Value1
key : Name2, Value : Value2
key : Name3, Value : Value3
key : Name3, Value : Value3
...................
key : Name100000, Value : Value100000
The data set is almost over 1000 records, I know that these are always going to be of type keyword, Is there any way I can maintain all this data in a single document and fetch the value for a given key.
ie . I want to fetch the value for Key = Name2 , and I want only its value. Is there anyway to write a query to get this data?
Just for 2 fields why should I create 1000 documents? Rather I can have this in a heterogeneous index that handles a lot of metadata for my application, and this could be one such document if the array filtering logic works out.
Here is my use case.
Lets say every time my application processes a particular word I need it to be replaced with another word, and there could be thousands of such words. What is the real value creation here? Maintaining so much jsons that I created in my code base is going to be a nightmare.
Where as If I can execute it as a single json with an array of such objects. I dont have to worry about maintaining these documents, and anyway the data is getting indexed whether I am storing it as nested or flat. So is there a solution to handle this?
Just for 2 fields why should I create 1000 documents?
As you prefer.
I personally always prefer indexing what I'm searching for than something else.
Like if I want to search for an object, I'll index an object and not an array of objects. Because what I want to get back is an object, nothing else.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.