What’s New: Data Search Improvements (For Developers) (2024 release wave 2)
Modern search in Business Central (2024 release wave 2) for developers: searches for all words instead of substrings, is enabled per field with the optimized for text search property, and applies to page search, lookup and company-wide search. Covers the new double and filter operator in SetFilter and full-text index generation.
- Introduction and Modern Search Overview
- Enabling Modern Search with optimized for text search Property
- Modern Search in Item Lists and Page Search
- Search Performance Comparison and Company-wide Search
- Modern Search in Lookup and Full-Text Index Generation
- Technical Implementation and API Usage
- Page Inspector and Filter Syntax Considerations
- Conclusion and Summary
Overview
The video explains modern search, which matches all words rather than any substring in a word and is significantly faster than the legacy search. It is demonstrated in item lists, page search, lookup and company-wide search, with a performance comparison against legacy search.
For developers, it shows how to enable modern search by setting the optimized for text search property on table and table extension fields. It also covers how the synchronization engine generates the full-text index, how the new double and filter operator works in the SetFilter method of the record API, and how the page inspector helps check generated filters, since the syntax can be hard to grasp.
Key points
- Check that ‘use optimize text search in lists’ is enabled in Feature management.
- Set optimized for text search = true on table fields or table extension fields to enable modern search on them.
- Apply the property to primary key, descriptive text and identifying fields users search on; avoid fields that have thousands of rows or are used for grouping.
- Modern search matches all words, word order does not matter, and it is faster than legacy substring search.
- Users can switch to legacy contains search with a star prefix (demoed as ‘star star 1303’) or the drop-down or cogwheel option, in page search, lookup and company-wide search.
- SetFilter has a new double and filter operator for full-text matching. On fields without the property it falls back to a case-insensitive contains search.
- Use the page inspection pane to see the generated filter syntax. Avoid the double and operator in explicit business logic, because its behavior depends on user settings and field properties.
Features
| Feature | Status | At |
|---|---|---|
| Modern Search | status not stated, demoed | 0:21 |
| optimized for text search Property | status not stated | 0:52 |
| Modern Search in Item Lists | status not stated, demoed | 2:03 |
| Double And Filter Operator | status not stated, demoed | 8:05 |
| Full-Text Search Index Generation | status not stated | 6:33 |
| Star Prefix for Legacy Search | status not stated, demoed | 4:23 |
| Company-wide Search with Modern Search | status not stated, demoed | 4:43 |
AL objects mentioned
As heard in the captions. A name that matches one object page by exact type and name links to it; the others stay as named.
- codeunit “data search and table code unit” at 10:21
Not found in BC28-30: codeunit “data search and table code unit”.
Quotes
- 0:21 “in this release we have added a method to search for all words rather than any substring in a word it’s a significantly faster”
- 0:52 “you use the new property optimized for text search equals true on your table Fields you can put it on your table fields or”
- 1:32 “you should add this to fields that the users want to find not to fields which where there are thousands of them or where”
- 2:03 “and in here you can see this line use optimize text search in lists and in this case it is enabled”
- 4:23 “so we’ve actually made it possible to switch directly by using the star star 1303 this will search in the Legacy way”
- 7:44 “the modern search on the other hand Builds an index on every word and now you have an index lookup into those words and”
- 8:05 “you can also use it on the record API it is built into the set filter method so you can now use the new”
- 10:01 “the syntax can be a little hard to grasp you saw the trick with using the page inspector to show the generated filters”
- 10:21 “you would normally avoid using this for explicit business logic where you’re better off using existing equals filters”
Presenters (as heard): Jens M Peterson.
