The string_long field type is not available to search_api for indexing.

Created on 21 August 2024, 4 months ago
Updated 3 September 2024, 4 months ago

Some custom field types (string_long, entity_reference, file, image, uri) use a custom data type. These custom data types are skipped in detection of possible fields to index in search_api. Will have to research solutions to make these recognized. Additionally, there are some unescaped html tags showing up in the search_api admin interface for custom fields that ARE detected. Will update the property labels for these types in a separate ticket.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡¨πŸ‡³China fishfree

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

Merge Requests

Comments & Activities

  • Issue created by @fishfree
  • Status changed to Postponed: needs info 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States apmsooner

    Custom fields are properties on a field. Add the field first and you should see the custom fields (ie; properties) exposed as values to index. Please verify this and update ticket.

  • πŸ‡¨πŸ‡³China fishfree

    @apmsooner. Thank you for your tip! I just found there is a plus sign + before the custom fields, clicked to expand it, then the sub-fields (properties) appeared with plus signs, then I can add them seperately as below:

    However. I cannot add text(long) and entity_reference sub-fields in a custom field to search_api index, as the screenshot below:

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

    Hmm.. yeah the styling is really odd here. The text_long and entity_reference custom field types are actually custom data types also so something is weird i guess with what search_api is using for the source. I'll have to do some research.

  • Status changed to Postponed 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States apmsooner
  • πŸ‡ΊπŸ‡ΈUnited States apmsooner
  • πŸ‡ΊπŸ‡ΈUnited States apmsooner

    The html is fixed in the related ticket. I've found a solution using event subscriber to get the unrecognized custom data types "recognized" by search api. I may not be able to immediately find solution for the entity reference relationship but I can at least get the string_long field types working. Patch will be available to test out shortly.

  • Merge request !60Map string_long data type for search_api. β†’ (Merged) created by apmsooner
  • Status changed to Needs review 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States apmsooner

    Providing a patch to get the string_long type recognized for indexing. I'll create another ticket to address the file, image and entity_reference field types as those are more complex to get relationship data and will need to research options.

  • Pipeline finished with Skipped
    4 months ago
    #264119
  • Status changed to Fixed 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States apmsooner

    Added sub-module to handle extended search api support. For now this is limited to extending the string_long custom field data type but will be the home for additional extension to handle entity_reference, image and file types in followup task(s).

  • Status changed to Fixed 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States apmsooner
  • πŸ‡ΊπŸ‡ΈUnited States apmsooner

    @fishfree - the entity_reference, file and image custom field types will be handled in this issue: https://www.drupal.org/project/custom_field/issues/3470853 ✨ Search API: Support mapping/indexing referenced entity properties Needs review . Please follow that issue and help with testing when ready to review. I should have a patch up hopefully tomorrow if not sometime over the weekend.

  • πŸ‡¨πŸ‡³China fishfree

    @apmsooner Thank you! Now, the text_long sub-field works with your commit.

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

    @fishfree - you can try the patch here for the nested entity properties: https://www.drupal.org/project/custom_field/issues/3470853 ✨ Search API: Support mapping/indexing referenced entity properties Needs review . Custom field types entity_reference, file and image are all supported.

Production build 0.71.5 2024