Make string fields default to "fulltext" field type

Created on 19 July 2021, about 3 years ago
Updated 1 July 2024, 2 months ago

Problem/Motivation

When adding an entity's title field to an index it defaults to using the "string" data type, which means the field's contents are not findable by searching the index. This results in a bad experience as additional steps (changing the field type) are needed for what would be the expected use case.

Proposed resolution

Change all "string" -like fields to use the "Fulltext" data type.

Remaining tasks

Work out how to make known string-like fields default to the "Fulltext" data type.
Make the change.
Write text coverage.

Feature request
Status

Active

Version

1.0

Component

General code

Created by

🇺🇸United States DamienMcKenna NH, USA

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.

  • 🇦🇹Austria drunken monkey Vienna, Austria

    @ DamienMcKenna: There’s the “Aggregate field” field type for this. Just create one fulltext field containing all the fulltext fields you want.
    Also, this has nothing to do with the issue in question anymore.

  • 🇩🇪Germany mkalkbrenner 🇩🇪

    FYI: Within Search API Solr we now have the auto_aggregated_fulltext_field which is comparabel to the old "content" field in the Solr schema of Drupal 6 and 7.

  • 🇮🇳India Vivek Panicker Kolkata

    I just created a new site and I was not aware that only full text fields were searchable.
    It took me a long time to get to know this fact.
    If indexed fields are fulltext by default, then it would be very helpful for those setting up a new site, since if someone is setting up a search index, they would surely want to search for content also.

  • 🇩🇪Germany mkalkbrenner 🇩🇪

    On more important note: facets can only be built from simple types like string or numeric, not from fulltext fields.

  • 🇮🇳India Vivek Panicker Kolkata

    Yes, that is true.
    But for facets, we need to install an additional module.
    Those who don't install that module and only need search available, which this module provides, for them searching will not work because the fields are not fulltext fields.
    I was wondering if we could like have default fulltext fields, then when the facets module is installed, clone the fulltext fields to text fields, using hook_modules_installed().

Production build 0.71.5 2024