Hi there,
I know I have something wrong here, because the results I'm retrieving include the searched letters, but they're just included anywhere, not necessarily in order as they were put in the search box. For example, if the search is "cat", a value returned might be "heart attack" bc it includes those three letters in any order.
I'd like my search to just be looking at the first letters of each word, or at least ensure that the letters are in a row, as searched. (There may be multiple words in each column).
Can someone help with my syntax? (A little too new at this...)
return '{"$or":[{"Product":{"$regex":"' + value.replace(/ /g, "|") + '","$options":"im"}},{"Company":{"$regex":"' + value.replace(/ /g, "|") + '","$options":"im"}}]}';