Fields Property Example

Control which fields are displayed in search results

What are Fields?

The fields prop determines which properties from your data are shown in the results list. This is different from keys which controls what you search in.

In this example:

let fields = ['japanese', 'english']

Even though the data contains japanese, romaji, and english, only japanese and english will be displayed in the results.

💡 Tip: You can still search through all fields, but you'll only see the ones specified in fields.

Sample data

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