Appearance
Global Search
Squizy provides a global search feature that searches across multiple columns of an entity simultaneously. The search is text-based, accent-insensitive, and supports multi-word queries.
How It Works
When a user types in the search bar, the framework:
- Splits the search text by whitespace into individual terms
- For each term, searches across all searchable columns with a
LIKE(contains) query - Combines results: all terms must match (AND between terms), any column can match (OR between columns)
Searching for "green shirt" finds entities where one column contains "green" AND any column contains "shirt".
Searchable Columns
By default, the framework determines which columns participate in global search. The following types are excluded:
| Type | Reason |
|---|---|
Boolean | Not meaningful for text search |
Date / Time / DateTime | Date-based text matching is unreliable |
TemporalAccessor subtypes | Same as above |
All other types (strings, numbers, enums) are included.
Enum Handling
Important
Global search only works with enums mapped as EnumType.STRING. Enums mapped as EnumType.ORDINAL are silently excluded from global search results.
This is because ordinal enums are stored as integers in the database, making text-based search impossible.
java
@Enumerated(EnumType.STRING) // ✅ Works with global search
private Status status;
@Enumerated(EnumType.ORDINAL) // ❌ Excluded from global search
private Status status;Collection and Relation Search
For relations and collections (@ManyToOne, @OneToMany, @ManyToMany), global search evaluates the match against the @DisplayFormat of the referenced entity — not against individual columns in the related table.
java
@SquizyEntity(displayFormat = "${street}, ${city}")
@Entity
public class Address {
private String street;
private String city;
private String zipCode;
}java
@OneToMany
private List<Address> addresses;Searching for "Baker" will match a Person if any of their addresses has a display format value containing "Baker" — meaning the match is evaluated against street and city (the fields in the displayFormat), but not against zipCode or other fields outside the display format.
INFO
The columns included in global search are determined by the frontend. There is no server-side searchable flag. If the frontend sends a collection path like addresses.zipCode as an explicit search column, the search targets that specific field directly instead of the display format.