Is it possible to search through a list of objects?
See original GitHub issueOne of the big reasons why I use Fuse is that I can pass a list of objects and it will search on a subset of keys. This requires additional indexing, I assume. Is it possible to do this with uFuzzy? It seems to only accept string[]
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Searching a list of objects in Python - Stack Overflow
I'm trying to figure out how to search a list of objects for objects with an attribute equaling a certain value. Below is...
Read more >Searching a list of objects in Python - GeeksforGeeks
Searching for a particular or group of objects can be done by iterating through a list. where,
Read more >Searching or Sorting a list of Objects Based on an Attribute in ...
Often, when you have a group of objects, you might be looking to sort them based not on their location in memory, but...
Read more >List<T>.Find(Predicate<T>) Method - Microsoft Learn
Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire List<T>.
Read more >How to Find an Element in a List with Java - Baeldung
Java itself provides several ways of finding an item in a list: The contains method; The indexOf method; An ad-hoc for loop; The...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
something like this (incomplete):
out of the box, no. but with bit of cleverness, yes.
the idea is to create a
string[]
by concat’ing the fields you’re interested in, using some rarely-used separator char like¦
. this effectively becomes your “index”. once you have this list you can use uFuzzy as normal. it’s not a perfect solution, but i think it will work quite well.it would take a bit more code to get the highlight ranges (
info.ranges
) properly partitioned based on offsets from prior¦
, but may not be necessary if you don’t intend to do partial match highlighting in the UI.this use case is on my demos TODO list, PRs welcome 😉