Skip to content

Searching a collection group through textSearchController #571

Open

Description

@faizanabidnaqvi

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.

Activity

  1. fgatti675 commented on Oct 20, 2023

    @fgatti675
    Member

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

  2. faizanabidnaqvi commented on Oct 20, 2023

    @faizanabidnaqvi
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions