Skip to content

Commit 2de3d05

Browse files
committed
Updated Searching section
1 parent 4bf404b commit 2de3d05

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

15/umbraco-ui-builder/searching/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
description: Configuring searching in Umbraco UI Builder, the backoffice UI builder for Umbraco.
2+
description: Configure search functionality in Umbraco UI Builder.
33
---
44

55
# Searching
66

7-
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.
7+
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.
88

99
![Search](../images/search.png)
1010

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,44 @@
11
---
2-
description: Configuring searchable properties in Umbraco UI Builder, the backoffice UI builder for Umbraco.
2+
description: Configure searchable properties in Umbraco UI Builder.
33
---
44

55
# Searchable Properties
66

7-
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.
7+
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.
88

9-
You can also use any `String` based property of nested objects of a model, as long as the parent object is not null.
9+
Both direct `String` properties and `String` properties within nested objects can be made searchable, provided the parent object is not `null`.
1010

1111
![Search](../images/search.png)
1212

13-
## Defining searchable properties
13+
## Defining Searchable Properties
1414

15-
### **AddSearchableProperty(Lambda searchablePropertyExpression) : CollectionConfigBuilder<TEntityType>**
15+
### Using `AddSearchableProperty()` Method
1616

17-
Adds the given property to the searchable properties collection.
17+
Use `AddSearchableProperty` to specify which properties should be included in search functionality.
1818

19-
````csharp
20-
// Example
19+
#### Method Syntax
20+
21+
```cs
22+
AddSearchableProperty(Lambda searchablePropertyExpression) : CollectionConfigBuilder<TEntityType>
23+
```
24+
25+
#### Example
26+
27+
````cs
2128
collectionConfig.AddSearchableProperty(p => p.FirstName);
2229
collectionConfig.AddSearchableProperty(p => p.Address.Street);
2330
````
2431

2532
## Search Expression Pattern
2633

27-
Up to version 15.0.1, the search was performed using the `StartsWith` method call.
28-
From 15.0.1 and up, search operations can be performed using the `Contains` method call.
34+
The search behavior differs based on the version:
35+
36+
- Up to version 15.0.1: Search uses the `StartsWith` method, meaning results include entries that begin with the search term.
37+
- 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.
38+
39+
### Example
2940

3041
````csharp
31-
// Example
3242
collectionConfig.AddSearchableProperty(p => p.FirstName); // will search for keywords that start with.
3343
collectionConfig.AddSearchableProperty(p => p.FirstName, )SearchExpressionPattern.Contains); // will search for keywords that are contained.
3444
````

0 commit comments

Comments
 (0)