Product Updates

DatoCMS changelog for new features and general improvements
Content Management API

Site search now supports fuzzy search

September 6th, 2022

We just introduced a new parameter that can be added to the filter parameter of site search to enable a fuzzy search. When the parameter fuzzy filter is present, our search engine will find strings that approximately match the query provided.

Here is an example of how to use the feature:

1
const searchResults = await client.searchResults.list({
2
page: {
3
offset: 200,
4
limit: 20
5
},
6
filter: {
7
fuzzy: true,
8
query: 'florance',
9
build_trigger_id: '44',
10
locale: 'en'
11
}
12
});
13
14
searchResults.forEach((searchResult) => {
15
console.log(searchResult);
16
});

In this example, strings like florence will be matched, even if the query is florance.

Please refer to the site search page in the Content Management API documentation for a complete example.

Start using DatoCMS today
According to Gartner 89% of companies plan to compete primarily on the basis of customer experience this year. Don't get caught unprepared.
  • No credit card
  • Easy setup
Subscribe to our newsletter! 📥
One update per month. All the latest news and sneak peeks directly in your inbox.
support@datocms.com ©2024 Dato srl, all rights reserved P.IVA 06969620480