How to correctly define indices?

I want to add Algolia’s InstantSearch to my Angular 8 web app. I’ve spent a couple days reading the docs, watching videos, examples, adding a couple indices, and searchable attributes. But I can’t figure out how to define indices and attributes that meets my search goals.

One goal might be how to create account, another could be show device commands. When I test my indices using the dashboard UI Demos Show option, and typing in my search terms, the results I’m looking for don’t show up.

What’s correct way to define the indices and searchable attributes?

Index 1
{
“feature”: “account”,
“operations”: [
“create”,
“cancel”,
“pay”,
“upgrade”,
“learn”
],
“webpages”: [
“#/account”
],
“descriptions”: [
“To create an account, see this webpage: #WEBPAGE#”
],
“documents”: [
https://mywebapp.com/faq.pdf
],
“objectID”: “8553429000”
}

Index 2
{
“feature”: “device”,
“operations”: [
“add”,
“edit”,
“delete”,
“learn”
],
“webpages”: [
“#/learn”
],
“descriptions”: [
“To learn about creating a device, see this webpage: #WEBPAGE#”
],
“documents”: [
https://mywebapp.com/faq.pdf
],
“objectID”: “85534280”
}

Hi there,

My name is Kevin and I am a member of the Algolia Support Team here to help.

Your search query is “how to create account.” The Algolia engine will compare these strings with the records’ searchable attributes configured on the index in question. I can see from your image that the searchable attributes you have configured are “documents,” “feature,” and “operations.”

Your first record has the following set for those 3 searchable attributes:

documents = “https://mywebapp.com/faq.pdf”
feature = “account”
operations = “create”, “cancel”, “pay”, “upgrade”, "learn”

The second record has the following for the same 3 searchable attributes:

documents = “https://mywebapp.com/faq.pdf”
feature = “device”
operations = “add”, “edit”, “delete”, “learn”

So the first record should likely match (as it has the words “account” and “create”) but not the second.

Can you clarify for me – you have the two records labeled as “Index 1” and “Index 2” – are these truly separate indices? Or are they just records in the same index?

Do you have your Application ID and Index Name available so I can take a deeper look? If you’d like, you could provide these and create a case by e-mailing support@algolia.com.

For posterity… the resolution to this issue is to enable “Remove Stop Words” in English in the index configuration settings.

Thanks Kevin for all your help!

Bob