Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching a collection group through textSearchController #571

Open
faizanabidnaqvi opened this issue Oct 12, 2023 · 2 comments
Open

Searching a collection group through textSearchController #571

faizanabidnaqvi opened this issue Oct 12, 2023 · 2 comments

Comments

@faizanabidnaqvi
Copy link

Hi!

I am not sure if this is a bug or a feature request. I tried using textSearch on a collection group by adding textSearchEnabled: true to the group. I also set up a search index based on the path. This resulted in showing the search bar in a collection group view.

However, I can't make it work. Seems like the data source searches based on a path like 'locale' so when we return ids from the text search controller, it will look for a doc like locales/[id] in firebase which is incorrect for a collection group based on a subcollection.

It would be nice if we could return a full doc path instead of just an id through the textSearchController; so we can return something like testDocs/flAzEev0jUq9G9YONPuX/locales/en-US and show the searched entities in the collection group view. This can be accomplished in Algolia either by setting the objectID to the full path or adding an additional path field in Algolia for an entity.

I understand that I can accomplish this through a custom data source which I will be trying in a couple of days but not sure if the collection group view will handle it correctly.

@fgatti675
Copy link
Member

Hi @faizanabidnaqvi
That's an interesting use case.
So you are indexing all locales in a custom index?

@faizanabidnaqvi
Copy link
Author

Hey!

Thanks for getting back. Yes, I was thinking of indexing all locale subcollections docs in a single algolia index with the path being the object id.

That would make it easy to search all locales (in each locale subcollection), to find a certain term for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants