I am making simple SPFx search for SharePoint folders and files. How can I make search query that search results between start and end dates using QueryTemplate or Refiners properties?
return new Promise<ISearchResult[]>((resolve, reject) => {
pnp.sp.search({
Querytext: query,
RowLimit: 20,
StartRow: 0,
QueryTemlate:'search query there',
Refiners: 'search query there',
SelectProperties: ["Title", "Author", "Path", "FileType","RefinersTextListOWSTEXT"]
})
.then((results) => {
results.PrimarySearchResults.forEach((result) => {
_results.push({
title: result.Title,
description: result.HitHighlightedSummary,
link: result.Path,
author: result.Author,
filetype: result.FileType,
path: result.OriginalPath
});
});
})
.then(
() => { resolve(_results); }
)
.catch(
() => { reject(new Error("Error")); }
);
});