Problem/Motivation

Expose existing methods of Index and Server classes as config actions.

Issue fork search_api-3484304

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

a.dmitriiev created an issue. See original summary.

a.dmitriiev’s picture

Status: Active » Needs review
Issue tags: +Recipes initiative, +Starshot
borisson_’s picture

Status: Needs review » Reviewed & tested by the community

Looks super simple in code, I think we should just do this.

drunken monkey’s picture

I agree with @borisson_, this looks great. Thanks!
Merged. Thanks again!

drunken monkey’s picture

  • drunken monkey committed 0478f855 on 8.x-1.x
    Follow-up to #3484304 by drunken monkey: Fixed case of boolean constants...

  • drunken monkey committed f9d0917f on 8.x-1.x
    Follow-up to #3484304 by drunken monkey: Fixed case of boolean constants...
thejimbirch’s picture

This is so cool! I believe this is the first contib config action.

1. As a general best practice in recipes, we strive to make recipes/config actions non-destructive. Will removeDatasource, removeProcessor, and removeField present the possibility of a recipe breaking a site? What would those actions be used for?

2. Could we get a change order for this issue? As the first config actions in the contrib space. It would help with documentation in the Recipes Initiative and set precedent for other contrib modules to follow.

Something like this (Note: I am not sure that is how the actions work)

## Search Index

### `setOption/SetOptions` - Set index option(s)

Singular:
```
config:
  action:
    search_api.index.example:
      SetOption:
        cron_limit: 50
```

Plural:
```
config:
  action:
    search_api.index.example:
      SetOptions:
        cron_limit: 50
        index_directly: true
        track_changes_in_references: true
```

### `removeDatasource` - Remove datasource from index

...

### `removeProcessor` - Remove processor from index

...

### `renameField` - Rename index field

...

### `removeField` - Remove field from index

...

## Search Server

### `setBackendConfig` - Set backend config
borisson_’s picture

Status: Reviewed & tested by the community » Fixed

I think this issue was supposed to be marked as fixed?

drunken monkey’s picture

1. As a general best practice in recipes, we strive to make recipes/config actions non-destructive. Will removeDatasource, removeProcessor, and removeField present the possibility of a recipe breaking a site? What would those actions be used for?

Yes, those all have the potential to break a site or cause security problems.

2. Could we get a change order for this issue? As the first config actions in the contrib space. It would help with documentation in the Recipes Initiative and set precedent for other contrib modules to follow.

That doesn’t seem like something we normally use change records for, as it’s just a new functionality.
Wouldn’t a documentation page make more sense? I’d support adding a page to our existing documentation, maybe under “Developer documentation”. However, I don’t think I understand recipes and config actions enough to write this myself.

Status: Fixed » Closed (fixed)

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