Keys Property Example

Control which fields are searchable in your data

What are Keys?

The keys prop determines which properties in your data are searched. When you type in the search box, FuzzySearch only looks through the fields specified in keys.

In this example:

let keys = ['romaji', 'english']

Your search will only match text in the romaji and english fields. Searches won't match text in the japanese field.

🔍 Try it: Type "iku" (romaji) or "go" (english) to find results. Japanese characters won't work because japanese is not in the keys array.

Sample data

  
[
	{
		"japanese": "行く",
		"romaji": "iku",
		"english": "go"
	},
	{
		"japanese": "見る",
		"romaji": "miru",
		"english": "see, look at"
	},
	{
		"japanese": "多い",
		"romaji": "ooi",
		"english": "a lot of, many"
	},
	...
]