Skip to content

Index second-hop relationships into Typesense for faceted search #665

Description

@jamiefolsom

When a record is indexed into Typesense, its direct relationships are embedded in the document (e.g., a Person includes its related Places). This allows faceted search by directly related records.

Some projects need to filter or facet across two relationship hops — for example, searching People and filtering by Company, where the connection goes Person → Place → Company. This isn't possible today because build_relationships in core-data-connector's search/base.rb sets include_relationships: false when serializing related records, stopping at one hop.

A targeted change to optionally include second-hop relationship data at index time would make these indirect connections facetable without requiring a Typesense server upgrade or collection restructuring. The documents would be larger, but for typical project sizes this should be negligible.

The indexing change would be in core-data-connector (app/services/core_data_connector/search/base.rb, around line 351). The front-end facet UI in core-data-places should pick up the new facetable fields automatically via FacetStateContextProvider.

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