Forum Discussion
Configuring PnP Modern Search v4 to Display Search Results Based on Partial Keywords
- Dec 15, 2023
Hello arine1901
you can use * as a wildcard after the term do you search. As example:
No results
And now with *:
You can find more about search syntax:
Please attention: KQL queries don't support prefix matching with the wildcard * as prefix.
Best, Dave
arine1901 To enhance partial keyword search in your PnP Modern Search v4 setup, modify the query template by incorporating fuzzy search operators. These operators enable searching for words similar to the specified term, even if they're not an exact match.
{queryTerms:contains(["*Sura*", *Surabaya*]) Path:https://{my-o365}.sharepoint.com/sites/{my-site/my-subsite}/Lists/{list-name} contentclass:sts_listitem}
{queryTerms:contains(["*Sura*", *Surabaya*]) Specifies the search terms using the contains operator. In this case, it looks for words containing the substring "Sura" or the exact term "Surabaya."
Path:https://{my-o365}.sharepoint.com/sites/{my-site/my-subsite}/Lists/{list-name} contentclass:sts_listitem Specifies the source of search results, targeting the SharePoint List named "list-name" in the "my-subsite" subsite of "my-site" on the "my-o365" O365 tenant.