Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
src/Plugin/search_api/processor/AggregatedFields.php:380
public function alterPropertyDefinitions(array &$properties, DatasourceInterface $datasource = NULL) {
....
$properties[$field_id] = BasicProperty::createFromDefinition($definition)->setLocked();
It is not possible to override the 'String' field to 'Fulltext' anymore because it's locked.
Comment | File | Size | Author |
---|---|---|---|
#5 | 2479967-5--locked_field_types--interdiff.txt | 10.71 KB | drunken monkey |
#5 | 2479967-5--locked_field_types.patch | 17.57 KB | drunken monkey |
|
Comments
Comment #1
R.Muilwijk CreditAttribution: R.Muilwijk commentedComment #2
R.Muilwijk CreditAttribution: R.Muilwijk commentedComment #3
drunken monkeyThanks for reporting this problem and providing a patch!
However, I fear this is not so easy to resolve. We lock the field since we say that it doesn't make sense to add a field via a processor but then not index it. I think it's hard to argue with that logic, and it's the same for all processors that add fields.
However, I obviously forgot that there are two types of "locked" fields – fields that are used internally, like
search_api_language
andsearch_api_node_grants
, and for which it is therefore critical to also lock the field type, since they'll otherwise be useless; and fields which we just want to index as long as the processor is enabled, but for which it is fine if the user chooses a different field type. Consequently, there is now no way to implement the latter – and we'll therefore need to change that.I'd suggest just adding a third property flag, "has type locked", for those fields of the first kind and let users freely change the type (and boost) of the others.
Comment #4
mollux CreditAttribution: mollux commentedFirst attempt to split up + clean up of the additional field code, as some parts aren't shared anymore with the field code.
Comment #5
drunken monkeySmall tweaks, otherwise it looks great. Thanks a lot!
Comment #6
mollux CreditAttribution: mollux commentedok!
Comment #7
drunken monkeyExcellent, thanks for reviewing, and thanks again for your work!
Committed.