MetaModels
2.4
  • Introduction to MetaModels
  • Feature Overview
  • Installing and Updating MetaModels
  • Components of a MetaModel
    • Workflow in MetaModels
    • New MetaModel
    • Attributes
    • Render Settings
    • Input Forms
    • Visibility Conditions / Sub-Palettes
    • Indexing
    • Filter Sets
      • Introduction
      • Types of Filter Rules
      • Configuration Parameters
      • Procedure
      • Details of All Filter Rules
        • Predefined Item Set
        • Simple Lookup
        • Custom SQL
        • AND Condition
        • OR Condition
        • Expression Rule
        • Checkbox Status
        • Translated Checkbox Status
        • Yes / No
        • Value from/to for one field
        • Value from/to for one date field
        • Value from/to for two fields
        • Value from/to for two date fields
        • Single Select
        • Multi-Select
        • Text Filter
        • Perimeter Search
        • Register
        • Levenshtein-based Search
        • Filter-by-related
        • Loupe
        • Parent Filter
    • Input/Render Assignments
    • Content Elements/Modules for Frontend Output
    • Relations in MetaModels
    • Schema Manager
    • Symfony Translation
    • Templates in MetaModels
    • Storing Data Types as Attributes
    • Multilingual Support in MetaModels
    • Insert Tags
  • The First MetaModel
  • Extensions
  • MetaModels “Cookbook”
  • Videos and Podcasts about MetaModels
  • MetaModels Reference and API
  • Imprint, Privacy Policy, Licence, Credits
MetaModels
  • Components of a MetaModel
  • Filter Sets
  • Levenshtein-based Search
  • Edit on GitHub

img_filter_default Levenshtein-based Search

The “Levenshtein-based Search” filter rule (package attribute_levenshtein) creates a full-text index over selected attributes and enables a similarity-based full-text search with autocomplete. The search is based on the Levenshtein distance algorithm, which also finds typos and similar-sounding terms.

A prerequisite is the installation of the Levenshtein attribute, which builds the search index in its own table. The included template mm_filteritem_levenshtein.html5 contains the necessary JavaScript logic for autocomplete.

See also

Detailed documentation on the Levenshtein attribute: Levenshtein

Installation

The filter rule is installed via the Contao Manager or Composer:

composer require metamodels/attribute_levenshtein

Settings when Creating the Filter Rule

Setting

Description

Type

Selection of the filter rule type — here: “Levenshtein-based Search”.

Enabled

Enables or disables this filter rule.

Comment

Free text field for describing the purpose of this filter rule.

Attribute

The Levenshtein attribute that provides the search index.

Settings for the Frontend Widget

Setting

Description

URL parameter

The key of the URL parameter for passing the filter value. Without input, the column name of the attribute is used. With auto_item, only the value — without key — is embedded in the URL.

URL type for the parameter

Defines whether the parameter is passed as a slug (friendly URL) or as a GET parameter (from MM 2.4) — see SEO

Label

Label of the search input field.

Hide label at filter widget

Suppresses the output of the label.

Template

Template for the widget output. Default: mm_filteritem_levenshtein (contains JavaScript for autocomplete).

Placeholder

Placeholder text in the search input field.

CSS ID/class

Sets a CSS ID or class on the widget element.

Enable autocomplete

Enables the JavaScript-based autocomplete while typing. Default: active.

Minimum characters for autocomplete

Number of characters at which autocomplete is triggered. Default: 3.

Auto-submit

The search form is automatically submitted when an autocomplete suggestion is selected.

Matching Attributes

The “Levenshtein-based Search” filter rule works exclusively with the special Levenshtein attribute:

  • Levenshtein

The Levenshtein attribute can in turn index multiple other attributes (text, long text, alias, etc.).

Previous Next

© Copyright 2026, Team MetaModels. Last updated on 06-12-2026.