Presented below is a dataset:
persons = [
{
"age":20,
"parameter1":94,
"name":"Foobarin"
},
{
"age":33,
"parameter1":49,
"name":"Johan"
}
]
I am looking to develop a sophisticated live search functionality that can identify specific patterns. For example, inputting "foo a20 p94" should return the first object. a20 - Search based on an age of 20 p94 - Search for parameter1 value of 94 Additionally, any text without a specified prefix will be compared against the name field.
All values, except for names which are case-insensitive, are integers. I intend to restrict prefixes to predefined options like a, p, and exclude formats like age20. The dataset contains approximately 400 entries.
I have already implemented a basic live search that scans all variables within the objects. However, I'm unsure about the next steps. Any suggestions?