Which gives better search performance? Search in list element or search in text


(Heeren Sharma) #1

To give a better context, if I have a field called "countries".
Value of countries can be put as a space separated string (type string) e.g. "de en es"
or it can be saved as a proper list (type object) e.g. ["de", "en", "es"].
I want to use this field for filtering of my search queries.
My concern is about the search performance (scaling) over real time searches (a lot).
Thank you for your insights.


(Xavier Facq) #2

Hi, I suggest you to use an array of String not_analyzed.


(Heeren Sharma) #3

Thank you for your reply.
Can you give some more reasoning how array is better than plain string ?


(Xavier Facq) #4

Because your field doesn't need to be analysed and will be used as a filter (faster) So values need to be splitted. Moreover, you will be able build aggregation on it.


(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.