Service classes and processors (and data alterations in D7) already have them – now we should allow datasources to define configuration forms, too. While this hasn't been a big annoyance so far, at least as far as I know, there's still use cases where you want to provide some configuration for an item type, and having that nicely integrated into the index settings definitely makes more sense than forcing modules to provide a separate configuration page.

Like for processors (#2044311: Change workflow plugin system), we should probably let the datasource decide whether re-indexing is necessary when settings change. (On the other hand, it being the datasource, this could also just be implemented in the configFormSubmit() method without any module code supporting it.)

Another idea would be to let datasource controllers modify indexes before they are created, to apply type-specific defaults. That way we could, e.g., resolve the current UX problem of new users often not knowing what fields they should index (and what processors they should use – but that latter part we cannot really tackle this way, I guess). We could provide sensible defaults for all core (content) entity types and provide some simple hook (or similar) to let contrib modules define default fields for their custom entity types.
This would also be very practical for #2126979: Overhaul the "Multi-Index Searches" module – if we provide the different entities' fields as sub-properties of a virtual new super-item, then this would allow us to pre-select the fields of those sub-entities, thus freeing the user from the need to manually add all of them through "Add related fields".

Comments

drunken monkey’s picture

Issue summary: View changes
Parent issue: » #2044421: [meta] Upgrade to Drupal 8
drunken monkey’s picture

drunken monkey’s picture

See #1184610-32: Limit indexes to specific entity bundles: if we make datasource controller configurable per index, we should definitely handle it like processors and pass the index and configuration right when creating it.

drunken monkey’s picture

Title: Let datasources define configuration forms » Make datasource controllers more powerful
Issue summary: View changes

Another idea would be to let datasource controllers modify indexes before they are created, to apply type-specific defaults. That way we could, e.g., resolve the current UX problem of new users often not knowing what fields they should index (and what processors they should use – but that latter part we cannot really tackle this way, I guess). We could provide sensible defaults for all core (content) entity types and provide some simple hook (or similar) to let contrib modules define default fields for their custom entity types.
This would also be very practical for #2126979: Overhaul the "Multi-Index Searches" module – if we provide the different entities' fields as sub-properties of a virtual new super-item, then this would allow us to pre-select the fields of those sub-entities, thus freeing the user from the need to manually add all of them through "Add related fields".

drunken monkey’s picture

Status: Active » Fixed

I'd say this is more or less fixed now.
I don't think we should let the datasource just change the index. There could/should be a method for getting default field suggestions, to be incorporated in something like the wizard suggested in #2387893: Overhaul administration UI, but that's a separate issue, I'd say.

Status: Fixed » Closed (fixed)

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