Problem/Motivation

Currently we use $index->getFields() in SearchApiSolrService::search() to get the indexed fields, unfortunately this doesn't know / return search_api_id and search_api_relevance.
Currently we already handle this for field names, see $index->getFieldNames().

The missing entries in $index_fields causes errors e.g. when grouping by one of the missing fields - the group handling does this $index_fields[$collapse_field]['type'] - which will throw a notice.

Proposed resolution

Manually add the fields to the array $index_fields, or add a getFields() method which works similar to getFieldNames() and encapsulates this special knowledge.

Remaining tasks

Reviews needed.

User interface changes

None.

API changes

None.

Comments

drunken monkey’s picture

Status: Needs review » Fixed

Hm, while using these special fields for grouping isn't explicitly supported, if it works with just these few lines I guess we can just as well support it.
The patch also looks good, thanks a lot! I don't think an extra method is needed, we only get the index's fields this one time in the whole class anyways.

So, committed. Thanks again!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.