diff --git a/15/umbraco-ui-builder/searching/overview.md b/15/umbraco-ui-builder/searching/overview.md index 3d91fcb6f60..fa2c3d0b4b0 100644 --- a/15/umbraco-ui-builder/searching/overview.md +++ b/15/umbraco-ui-builder/searching/overview.md @@ -1,10 +1,10 @@ --- -description: Configuring searching in Umbraco UI Builder, the backoffice UI builder for Umbraco. +description: Configure search functionality in Umbraco UI Builder. --- # Searching -Beyond listing collection entities, if you need to be able to locate specific entities within a collection then Umbraco UI Builder provides a search API. +Umbraco UI Builder includes a search API for filtering and locating specific entities within a collection. This enhances usability, especially in collections with large datasets. ![Search](../images/search.png) diff --git a/15/umbraco-ui-builder/searching/searchable-properties.md b/15/umbraco-ui-builder/searching/searchable-properties.md index 0caba9e7019..147daae2483 100644 --- a/15/umbraco-ui-builder/searching/searchable-properties.md +++ b/15/umbraco-ui-builder/searching/searchable-properties.md @@ -1,34 +1,44 @@ --- -description: Configuring searchable properties in Umbraco UI Builder, the backoffice UI builder for Umbraco. +description: Configure searchable properties in Umbraco UI Builder. --- # Searchable Properties -Searchable properties allow you to define any `String` based properties on a model. They will be searchable via Umbraco UI Builder's list view and entity picker search controls. +Searchable properties allow you to define any `String` based properties in a model. It can be searched via Umbraco UI Builder's list view and entity picker search controls. -You can also use any `String` based property of nested objects of a model, as long as the parent object is not null. +Both direct `String` properties and `String` properties within nested objects can be made searchable, provided the parent object is not `null`. ![Search](../images/search.png) -## Defining searchable properties +## Defining Searchable Properties -### **AddSearchableProperty(Lambda searchablePropertyExpression) : CollectionConfigBuilder<TEntityType>** +### Using `AddSearchableProperty()` Method -Adds the given property to the searchable properties collection. +Use `AddSearchableProperty` to specify which properties should be included in search functionality. -````csharp -// Example +#### Method Syntax + +```cs +AddSearchableProperty(Lambda searchablePropertyExpression) : CollectionConfigBuilder +``` + +#### Example + +````cs collectionConfig.AddSearchableProperty(p => p.FirstName); collectionConfig.AddSearchableProperty(p => p.Address.Street); ```` ## Search Expression Pattern -Up to version 15.0.1, the search was performed using the `StartsWith` method call. -From 15.0.1 and up, search operations can be performed using the `Contains` method call. +The search behavior differs based on the version: + +- Up to version 15.0.1: Search uses the `StartsWith` method, meaning results include entries that begin with the search term. +- Version 15.0.1 and later: Search can be configured to use `Contains`, allowing results that include the search term anywhere within the property value. + +### Example ````csharp -// Example collectionConfig.AddSearchableProperty(p => p.FirstName); // will search for keywords that start with. collectionConfig.AddSearchableProperty(p => p.FirstName, )SearchExpressionPattern.Contains); // will search for keywords that are contained. ````