Currently, the saved configuration of the "Aggregated Fields" processor looks something like this (example with one aggregated field defined):

      settings:
        fields:
          search_api_aggregation_1:
            label: 'Title &'
            type: union
            type_descriptions:
              union: ''
              concat: ''
              sum: ''
              count: ''
              max: ''
              min: ''
              first: ''
            fields:
              'entity:comment/subject': 'entity:comment/subject'
              'entity:node/title': 'entity:node/title'
              'entity:taxonomy_term/name': 'entity:taxonomy_term/name'
              'entity:user/name': 'entity:user/name'
              'entity:comment/changed': 0
              'entity:comment/field_name': 0
              'entity:comment/cid': 0
              'entity:comment/comment_type': 0
              'entity:comment/comment_body:processed': 0
              'entity:comment/comment_body': 0
              'entity:comment/comment_body:format': 0
              'entity:comment/created': 0
              'entity:comment/mail': 0
              'entity:comment/entity_id': 0
              'entity:comment/entity_type': 0
              'entity:comment/homepage': 0
              'entity:comment/hostname': 0
              'entity:comment/langcode': 0
              'entity:comment/name': 0
              'entity:comment/pid': 0
              'entity:comment/status': 0
              'entity:comment/thread': 0
              'entity:comment/uid': 0
              'entity:comment/uuid': 0
              'entity:node/uid': 0
              'entity:node/created': 0
              'entity:node/body': 0
              'entity:node/changed': 0
              'entity:node/field_image': 0
              'entity:node/langcode': 0
              'entity:node/nid': 0
              'entity:node/promote': 0
              'entity:node/status': 0
              'entity:node/vid': 0
              'entity:node/revision_log': 0
              'entity:node/revision_timestamp': 0
              'entity:node/revision_uid': 0
              'entity:node/sticky': 0
              'entity:node/field_tags': 0
              'entity:node/type': 0
              'entity:node/uuid': 0
              'entity:taxonomy_term/changed': 0
              'entity:taxonomy_term/description': 0
              'entity:taxonomy_term/langcode': 0
              'entity:taxonomy_term/tid': 0
              'entity:taxonomy_term/parent': 0
              'entity:taxonomy_term/uuid': 0
              'entity:taxonomy_term/vid': 0
              'entity:taxonomy_term/weight': 0
              'entity:user/changed': 0
              'entity:user/created': 0
              'entity:user/mail': 0
              'entity:user/init': 0
              'entity:user/langcode': 0
              'entity:user/access': 0
              'entity:user/login': 0
              'entity:user/pass': 0
              'entity:user/user_picture': 0
              'entity:user/preferred_admin_langcode': 0
              'entity:user/preferred_langcode': 0
              'entity:user/roles': 0
              'entity:user/signature': 0
              'entity:user/signature_format': 0
              'entity:user/timezone': 0
              'entity:user/uid': 0
              'entity:user/status': 0
              'entity:user/uuid': 0
            actions:
              remove: 'Remove field'
        actions:
          add: 'Add new Field'

Clearly, that needs to be significantly improved:

  • For each aggregated field, only the label, type and fields keys are really needed.
  • The fields key should just contain a (numerically indexed) sequence of the enabled fields, not the raw format used by the checkboxes form element. (That of course also means adapting the code that uses that configuration key, but that should be trivial enough.)

Estimated Value and Story Points

This issue was identified as a Beta Blocker for Drupal 8. We sat down and figured out the value proposition and amount of work (story points) for this issue.

Value and Story points are in the scale of fibonacci. Our minimum is 1, our maximum is 21. The higher, the more value or work a certain issue has.

Value : 1
Story Points: 3

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Nick_vh’s picture

Issue summary: View changes
Issue tags: +beta blocker
Nick_vh’s picture

Priority: Normal » Major

Moving to Major after discussion at Drupalcamp Vienna

mollux’s picture

Assigned: Unassigned » mollux
mollux’s picture

Nick_vh’s picture

Status: Needs review » Needs work

Mollux, can you show us how the new saved configuration looks like?

mollux’s picture

Status: Needs work » Needs review
processors:
    aggregated_field:
      processor_id: aggregated_field
      weights:
        preprocess_index: -10
      settings:
        fields:
          search_api_aggregation_1:
            label: bla2
            type: sum
            fields:
              - 'entity:node/body'
              - 'entity:node/changed'
              - 'entity:node/comment'
              - 'entity:node/created'
borisson_’s picture

Status: Needs review » Reviewed & tested by the community

Looks great!

mollux’s picture

Especially for Nick : added some documentation.

mollux’s picture

drunken monkey’s picture

Thanks, looks very good!
However, I just spotted that the processor's config schema is also a bit off. Specifically, we add the actions key there, which we of course are not storing (I hope).
Expanded patch attached, please test/review!

mashermike’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm that this patch cleans up the config export significantly.

Steps to reproduce:

  1. Install search_api and search_api_db
  2. Create a database server
  3. Create a index on the server
  4. Add an aggregate processor and configure concatenation of 2 fields
  5. Goto drupal single configuration export
  6. Export the search index

Before patch (only pertinent part of export shown):

     settings:
        fields:
          search_api_aggregation_1:
            label: test_field_1
            type: concat
            type_descriptions:
              union: ''
              concat: ''
              sum: ''
              count: ''
              max: ''
              min: ''
              first: ''
            fields:
              'entity:node/langcode': 'entity:node/langcode'
              'entity:node/nid': 'entity:node/nid'
              'entity:node/uid': '0'
              'entity:node/created': '0'
              'entity:node/body': '0'
              'entity:node/changed': '0'
              'entity:node/default_langcode': '0'
              'entity:node/field_ent_ref': '0'
              'entity:node/field_eref': '0'
              'entity:node/field_field_field': '0'
              'entity:node/field_image': '0'
              search_api_language: '0'
              'entity:node/promote': '0'
              'entity:node/status': '0'
              'entity:node/vid': '0'
              'entity:node/revision_log': '0'
              'entity:node/revision_timestamp': '0'
              'entity:node/revision_translation_affected': '0'
              'entity:node/revision_uid': '0'
              'entity:node/sticky': '0'
              'entity:node/field_tags': '0'
              'entity:node/title': '0'
              'entity:node/type': '0'
              'entity:node/uuid': '0'

After export (note - had to edit and save index to get updated values):

      settings:
        fields:
          search_api_aggregation_1:
            label: test_field_1
            type: concat
            fields:
              - 'entity:node/langcode'
              - 'entity:node/nid'

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Great to hear, thanks for testing!
Committed.
Thanks again, everyone!

Status: Fixed » Closed (fixed)

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