Refinement filters syntax in SharePoint

Copper Contributor

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-... . 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... 

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

@GeorgeT121997 

I hope you are doing well. Regarding your question, I had the same situation as you, and the solution is to use.

Operator, And

 

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

You can find more information about operators in this PDF.

https://interoperability.blob.core.windows.net/files/MS-FQL2/%5BMS-FQL2%5D.pdf

 

Most likely you found the solution, but in any case, this can help someone in this universe.