Skip to content

Search API Solr unsets the ID field from each result #3

Description

@DavidACameron-USDA

It assumes that each record has a 'search_api_id' field. Presumably, this field is included in all records that are indexed by Search API Solr. SAS looks for this field on every request. After it's done extracting results from the response, it unsets the field from the results array.

The datasource (well, the mapping alter hook in the .module file) maps the configured ID field to the 'search_api_id' key since SAS throws errors if that key isn't found. Then it gets unset. This prevents the ID field from being used in displays.

I've attempted to fix this by aliasing the configured ID field to 'search_api_id,' but that didn't work for me. I hoped Solr would duplicate the ID field to it and output both in the response, but it won't. It just renames the ID field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions