Problem/Motivation

When fields are added to the search index, text fields are detected by checking whether the field item class extends StringItemBase or TextItemBase. ListStringItem (the list_string field type) extends neither, so these fields are not treated as text fields and are left out of fulltext search.

The stored values of list_string fields are plain strings, and site builders often expect them to be searchable, for example a "Category" or "Type" select list. Searching for one of these values currently returns no results.

Steps to reproduce

  1. Add a List (text) field to a content type, e.g. field_category with allowed values news|News and event|Event.
  2. Create a node and select a value for the field.
  3. Index the content.
  4. Search for the selected value (e.g. news).
  5. The node is not returned, and the field is not indexed as a fulltext field.

Proposed resolution

Include ListStringItem and its subclasses in the text field check.

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

seanb created an issue. See original summary.

seanb changed the visibility of the branch 3625786-index-liststringitem-fields to hidden.

seanb changed the visibility of the branch 3625786-index-liststringitem-fields to active.

  • 011d9586 committed on 1.0.x
    Issue #3625786 by seanB: Index ListStringItem fields for fulltext search...
seanb’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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