question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fuzzy Search does not search under Groups

See original GitHub issue

As the title suggests, it does not. Per with example below, when I type “Display” to the search bar, it returns “Not found”. It does, however, search group value fields.

To Reproduce

const options = [
	{
		type: "group",
		name: "Sans",
		value: "sans",
		items: [
			{ name: "Display", value: "Display" },
			{ name: "Helvetica", value: "Helvetica" },
			{ name: "Playfair Display", value: "Playfair Display" }
		],
	},
	{
		type: "group",
		name: "Serif",
		value: "serif",
		items: [
			{ name: "Hallelujah", value: "Hallelujah" },
			{ name: "Gloria Hallelujah", value: "Gloria Hallelujah" },
			{ name: "VT323", value: "VT323" }
		],
	},
];
const [selectedFonts, setSelectedFonts] = useState<string[]>([]);
<SelectSearch
	options={options} 
	search={true}
	filterOptions={fuzzySearch}
	emptyMessage="Not found"
	multiple={true}
	closeOnSelect={false}
	printOptions="on-focus"
	placeholder="Choose Fonts"
	onChange={setSelectedFonts as any} 
/>

Expected behavior Search should also search under the group items.

Screenshots Before search: image After search: image

Desktop:

  • OS: Windows 10
  • Browser: Firefox
  • Version: 87.0

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tbleckertcommented, Apr 20, 2021

@icaroscherma Sweet work around!

And yes @yigitlevent , the built-in function should work with nested items as well. Seems something broke on the latest major release. Will take a look. Thanks for the report, appreciated!

1reaction
icaroschermacommented, Apr 19, 2021

I’ve message @tbleckert this morning once I figured that it might be a good idea to include items.name, items.value, so in future versions you might get away with default fuzzySearch. =)

I’m happy to help. =)

Read more comments on GitHub >

github_iconTop Results From Across the Web

There's more to fuzzy search than correcting typos | Algolia Blog
Fuzzy search matches words even if there are typos or misspellings, and fuzzy matching finds information based on similarities.
Read more >
Fuzzy Search feature does not work correctly with searchBE ...
searchBE function does not work correctly in case of Fuzzy search on BE. Exact matching works correctly. For instance, REST call does not...
Read more >
What is a Fuzzy Search? - TechTarget
A fuzzy search is performed using a fuzzy matching algorithm, which returns a list of results based on likely relevance even though search...
Read more >
fuzzy matching of nested data (ex: individuals \in families \in ...
I am trying to match the groups in D1 and D2 based on having the most families matched. Family matches are defined by...
Read more >
How to Use Fuzzy Searches in Elasticsearch | Elastic Blog
Fuzzy queries can most easily be performed through additional arguments to the match query type, as seen in the example below this paragraph ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found