Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module enhances the entity reference autocomplete widget by combining "starts with" and "contains" search logic. It displays results that start with your search term first, followed by results that contain the term elsewhere in the text, improving usability for fields with many potential entries.

This module provides an autocomplete widget for entity reference fields that combines "STARTS_WITH" and "CONTAINS" matching.
Other than that, the widget behaves exactly like the one from Drupal core.

The result has all the matches that start with the search string, followed by matches that only contain the search string but that don't start with it.

Features

Comparison with core entity autocomplete widget.

Search term Limit Core
STARTS_WITH Core
CONTAINS New:
Mixed matching "Frog" 3 Frog
Frog eggs 99 frogs
Acrobatic frog
Cyan frog Frog
Frog eggs
99 frogs “Frog” 1 Frog 99 frogs Frog “egg” 3 - Frog eggs Frog eggs

Use case

The main use case are reference fields with a large number of potential targets.
In these cases neither the "CONTAINS" nor the "STARTS_WITH" mode are completely suitable:

  • For "STARTS_WITH", there may be no results, if all the items start with a prefix like "The ..." or a number.
  • For "CONTAINS", the exact match may never show up, because the list is filled up with less relevant matches.

Post-Installation

Configure any entity form display, use the widget for an entity reference field.

Activity

Total releases
2
First release
Sep 2025
Latest release
10 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Slowing

Releases

Version Type Release date
1.1.0 Stable Sep 8, 2025
1.1.0-alpha1 Pre-release Sep 3, 2025