Forum Discussion

GeorgeT121997's avatar
GeorgeT121997
Copper Contributor
Sep 28, 2022

Refinement filters syntax in SharePoint

Hi there 

Recently, I created a SharePoint page, which uses PnP modern search v4 web parts. 

I have a PnP - Search field and PnP - Search results . They are both connected together. 

Note: all pages and documents are stored on my company's SharePoint domain. 

Originally 

In the PnP - Search results web part, Refinement filters was empty. 

When I typed in a search term and clicked [enter] or right arrow (>) button, it brought up all pages where the search term is in the page title, or in the page content

My Requirement 

Search for a web page where the page Title or page content contains searchTerms inputted in PnP - Search field

When Refinement filters, I noticed that it says "ex.: FileType:equals("docx") "

Currently 

In the PnP - Search results web part 

Refinement filters used currently: 

FileType:equals("aspx") and 
Title:ends-with(searchTerms) 

After saving this as a draft, when I type in a page to search for, e.g., "Amanda", the only result that comes up is a Word Document, that contains her name. No pages appear in the search Results at all. 

 

I did some searching on the internet and found FAST Query Language (FQL) syntax reference:
https://learn.microsoft.com/en-us/sharepoint/dev/general-development/fast-query-language-fql-syntax-reference . So I understand that I am using the right syntax for 'FileType:equals("aspx")', and Title:ends-with(searchTerms), when I just have one of those filters. 

My Question 

What syntax should I use when I want the Refinement filters to include 2 filters? 

Another links I have looked at 

What is the difference between Query text and Refinement filters:
https://learn.microsoft.com/en-us/answers/questions/640137/what-is-the-difference-between-query-text-and-refi.html 

Note: Apologies for the lack of images. At the moment when I try to insert an image it says "You do not have permission to upload images." 

Regards, 

George 

1 Reply

Resources