4 ms·
"Ona" and "Bednar" are in separate data fields. Do standard JS implementations handle this case? Is that even desired - treating each word as an isolated search
by resu_nimda 13y ago
"Ona" and "Bednar" are in separate data fields. Do standard JS implementations handle this case? Is that even desired - treating each word as an isolated search? Interestingly, because of the concatenated data issue, "onabednar" does return the record ("it's a feature!").
The example only supports single words because it contains only single-word data. If you edit one of the indexes to include a space it works.
- mistercow 13y agoI have never seen another search implementation that only allowed you to search one word. You don't treat each word as an isolated search, you simply check that each word is contained in a field. I guarantee that almost any user will be confused by a search that works like this demo the moment they try to search for someone's full name. But no, it won't work correctly just by adding spaces to the index. That will only work if the fields you enter are adjacent. So if you typed "Ona Bednar", it would work, but "Bednar Ona" won't. That's not how users expect search to work. For a more ordinary example of what I mean, suppose the dataset included the middle name. Users will expect to find Ona Justine Bednar if they type "Ona Bednar". If it doesn't work that way, it's broken.
- resu_nimda 13y agoWell, I was talking about live search filtering of a dataset on the page, like this demo. Most are simple Ctrl+F text searches (when I said adding spaces would work, that was intended to only cover the case of an unbroken substring within one field). After a quick look I didn't find any demos that support multi-field searches, though it would certainly be possible.
- mistercow 13y agoI didn't find any demos that involved multiple fields at all. But "multiple fields" is not a concept that exists in most users' worlds. Names exist, and email addresses exist. They wouldn't try to search for "ona schamberger.frank@wuckert.com", but they will try to search for "ona bednar".