I have the following data
persons = [
{
"age":20,
"parameter1":94,
"name":"Foobarin"
},
{
"age":33,
"parameter1":49,
"name":"Johan"
}
]
I want to create an advanced live search which recognizes patterns. An examples could be "foo a20 p94" which would get me the first object. a20 - Search where age is 20 p94 - Search where parameter1 is 94 and then if there is any other text which does not have any set prefix then test that against the name value.
All the values (except name which is case-insensitive) is of type integer. I want to limit the prefixes to predefined such as a, p and not age20. The data-sets is around 400.
I've created a basic live search which searches all variables in the object, but now I do not know where to continue. Any ideas?
ag20be accepted too? Do all the parameters you're searching against (except name) have integer values? Should the search be case-insensitive? Realistically how big is the potential data-set? i.e. should you be thinking about indexing the data first... you need to start by explicitly defining the bounds else the question is too ambiguous.