use with with custom Fieldtype extends FileItem

Created on 11 September 2020, about 4 years ago
Updated 31 May 2023, over 1 year ago

Hello,

It will very extra to use search api attachments with custom Fieldtype that extends Drupal\file\Plugin\Field\FieldType\FileItem.

I've try to read the module to have a list of modification. By example :

* EntityTypeInfoHandler:entityBaseFieldInfo(EntityTypeInterface $entity_type)
if ($entity_type->id() != 'file') {

* ExtractedText
the fied_types in the annotation

Does anyone already have this use case ?

Phil

✨ Feature request
Status

Needs review

Version

9.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium philalawst

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States Arlina

    Here's a patch for 9.0.x that provides an extensible way to support other field types. It adds two new hooks:

    • hook_search_api_attachments_get_file_fields(): determine if a given field is of interest to search_api_attachments (make it selectable in the search index "add fields" configuration).
    • hook_search_api_attachments_add_field_values(): allows modules to add file entity IDs to the search index, given a field type, field name, and entity.

    In my scenario, I had a custom field that extended a field reference field, and the code needed to make it work with search_api_attachments is essentially what was added in the hooks description under search_api_attachments.api.php.

Production build 0.71.5 2024