naepalm
(Janae Cram)
February 6, 2025, 9:03pm
1
I posted this on discord so I thought I would copy it over and test my question here on the forums.
I’m working on setting up a searchable property in Umbraco UI Builder in Umbraco 14 and I know that the default is StartsWith - however, the recent versions have the ability to set how to use the search.
I can see that this was resolved in this issue on GitHub:
opened 08:03PM - 22 Oct 24 UTC
closed 02:38PM - 16 Dec 24 UTC
bug
state/sprint-candidate
release/13.1.6
release/14.0.1
release/15.0.1
**Describe the bug**
When added the following to a listview collection:
```
…
.AddSearchableProperty(x => x.Message)
```
a search field is shown. However entering a term only search match start on message text. So if message contains term, which is not first word, then no results are found.
**Steps To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment (please complete the following information):**
- Server OS: Windows 10
- Browser Chrome Version 129.0.6668.101
- Umbraco Version 13.4.1
- Product Version 13.1.5
---
_This item has been added to our backlog AB#45966_
The documentation here theoretically shows how to do it:
I can also confirm I am on a compatible version of Umbraco UI Builder (14.0.3) and I can access SearchExpressionPattern
so theoretically this should all “just work”…
However, there’s clearly an error in the documentation because there’s an extra parenthesis in the middle of the statement, which is invalid. If I cut that out and try it like this it tells me no overload .AddSearchableProperty()
takes two parameters.
What I assume the documentation should look like but doesn’t work:
collectionConfig.AddSearchableProperty(p => p.FirstName, SearchExpressionPattern.Contains);
Has anyone done this and knows the actual syntax for using SearchExpressionPattern.Contains
? Am I missing something obvious?
Example that doesn’t work is in my screenshot:
naepalm
(Janae Cram)
February 7, 2025, 5:04pm
2
Based on the conversation in Discord with Jemayn, I feel this is a bug in Umbraco UI Builder and I have reported it:
opened 04:54PM - 07 Feb 25 UTC
bug
**Describe the bug**
The ability to change the search function to "Contains" ins… tead of "StartsWith" is not working in version 14.0.3 despite the fact that both the releases and docs say that it should.
The previous issue regarding this is here, which is tagged for the 14.0.1 release: https://github.com/umbraco/Umbraco.UIBuilder.Issues/issues/116
The docs also reference that this should work as of 14.0.1: https://docs.umbraco.com/umbraco-ui-builder/14.latest/searching/searchable-properties#search-expression-pattern (Although there is a bug in that too with how it's typed; an extra parenthesis 😉 )
**Steps To Reproduce**
Steps to reproduce the behavior:
1. Set up a new UI Builder config in Visual Studio.
2. Attempt to add a searchable property to a list view
3. Update the SearchExpressionPattern to be contains, like so: `.AddSearchableProperty(p => p.OrderName, SearchExpressionPattern.Contains)`
4. See that that the code will not compile and that it says "No overload or method for `.AddSearchableProperty` takes 2 arguments"
**Expected behavior**
I expect that I should be able to use `.AddSearchableProperty(p => p.OrderName, SearchExpressionPattern.Contains)` and successfully change the search from starts with to contains.
**Screenshots**
Screenshot of the error:

When I look at the definition/implementation, it shows only the 1 argument for the `searchablePropertyExpression`

**Environment (please complete the following information):**
- Server OS: Windows 11, local machine
- Umbraco Version 14.2.0
- Umbraco UI Builder 14.0.3
1 Like