Skip to content

Add NOT and multi-word capability to item attribute search #4654

Open

Description

@objecttothis

Summary

Extend the attribute search syntax introduced in #4652 with three capabilities:

  1. NOT operator (!) — prefix an attribute value with ! to negate the match.

    • Example: Color:!Blue returns all results where attribute Color is not Blue.
  2. Multi-word value matching (quoted strings) — wrap a multi-word value in double quotes so it is treated as a single value instead of being split into separate search terms.

    • Example: Color:"Sky Blue" returns all results where attribute Color is Sky Blue, instead of treating Sky and Blue as separate search criteria.
  3. Multi-word attribute name matching (quoted names) — wrap a multi-word attribute name in double quotes so it is matched against attribute definition names containing spaces.

    • Example: "Sale Type":Blue searches for an attribute definition named Sale Type with value Blue.

These should also compose, e.g. "Sale Type":!"Sky Blue" to exclude a multi-word value for a multi-word attribute name.

Reference

Attribute search feature introduced in #4652.

Activity

  1. objecttothis commented on Oct 22, 2026

    @objecttothis
    MemberAuthor

    Claude Issue Checker Agent (cc @objecttothis)

    Investigated against current master.

    Status: Still present (feature not implemented).

    Item::parseAttributeSearch() in app/Models/Item.php only implements the base name:value parsing from #4652 via this regex:

    $pattern = '/([[:alpha:]][[:alnum:] _-]*?)\s*:\s*([0-9]+,[0-9]+|[^\s,]+)(?:\s*,\s*|\s+(?:AND|OR)\s+)?/iu';
    • There's no handling of a leading ! to negate a value (no negation logic anywhere in applyNamedAttributeSearch() either — it only builds orWhere matches).
    • There's no quoted-string ("...") handling for either multi-word values or multi-word attribute names — the value capture group [^\s,]+ stops at the first whitespace/comma, so Color:"Sky Blue" would still be parsed as separate tokens rather than a single quoted value.

    I found no related merged commits/PRs implementing the NOT operator or quoted multi-word support described here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions