diff --git a/documentation/Submit-PnPSearchQuery.md b/documentation/Submit-PnPSearchQuery.md index ab4427a2d..815c8d317 100644 --- a/documentation/Submit-PnPSearchQuery.md +++ b/documentation/Submit-PnPSearchQuery.md @@ -10,7 +10,7 @@ online version: https://pnp.github.io/powershell/cmdlets/Submit-PnPSearchQuery.h # Submit-PnPSearchQuery ## SYNOPSIS -Executes an arbitrary search query against the SharePoint search index +Executes an arbitrary search query against the SharePoint search index. ## SYNTAX @@ -48,35 +48,42 @@ Allows to run an arbitrary search query against the SharePoint search index. Submit-PnPSearchQuery -Query "finance" ``` -Returns the top 500 items with the term finance +Returns the top 500 items with the term finance. ### EXAMPLE 2 ```powershell Submit-PnPSearchQuery -Query "Title:Intranet*" -MaxResults 10 ``` -Returns the top 10 items indexed by SharePoint Search of which the title starts with the word Intranet +Returns the top 10 items indexed by SharePoint Search of which the title starts with the word Intranet. ### EXAMPLE 3 ```powershell Submit-PnPSearchQuery -Query "Title:Intranet*" -All ``` -Returns absolutely all items indexed by SharePoint Search of which the title starts with the word Intranet +Returns absolutely all items indexed by SharePoint Search of which the title starts with the word Intranet. ### EXAMPLE 4 ```powershell Submit-PnPSearchQuery -Query "Title:Intranet*" -Refiners "contentclass,FileType(filter=6/0/*)" ``` -Returns absolutely all items indexed by SharePoint Search of which the title starts with the word Intranet, and return refiners for contentclass and FileType managed properties +Returns absolutely all items indexed by SharePoint Search of which the title starts with the word Intranet, and return refiners for contentclass and FileType managed properties. ### EXAMPLE 5 ```powershell Submit-PnPSearchQuery -Query "contentclass:STS_ListItem_DocumentLibrary" -SelectProperties ComplianceTag,InformationProtectionLabelId -All ``` -Returns absolutely all items indexed by SharePoint Search which represent a document in a document library and instructs explicitly to return the managed properties InformationProtectionLabelId and ComplianceTag which will give insight into the sensitivity and retention labels assigned to the documents +Returns absolutely all items indexed by SharePoint Search which represent a document in a document library and instructs explicitly to return the managed properties InformationProtectionLabelId and ComplianceTag which will give insight into the sensitivity and retention labels assigned to the documents. + +### EXAMPLE 6 +```powershell +Submit-PnPSearchQuery -Query "contentclass:STS_ListItem_DocumentLibrary" -SortList @{"filename" = "ascending"} -All +``` + +Returns absolutely all items indexed by SharePoint Search which represent a document in a document library and sorts the items by file name in ascending order. ## PARAMETERS @@ -137,7 +144,7 @@ Accept wildcard characters: False ``` ### -Culture -The locale for the query. +The locale for the query. Uses LCID's as per this [documentation](https://learn.microsoft.com/previous-versions/office/sharepoint-csom/jj167546(v=office.15)). ```yaml Type: Int32 @@ -319,7 +326,7 @@ Accept wildcard characters: False ``` ### -Refiners -The list of refiners to be returned in a search result. +The list of refiners to be returned in a search result, separated by a comma. I.e. contentclass,ContentType(filter=7/0/*). ```yaml Type: String @@ -333,7 +340,7 @@ Accept wildcard characters: False ``` ### -RelevantResults -Specifies whether only relevant results are returned +Specifies whether only relevant results are returned. ```yaml Type: SwitchParameter @@ -361,7 +368,7 @@ Accept wildcard characters: False ``` ### -SortList -The list of properties by which the search results are ordered. +The list of properties by which the search results are ordered as a hashtable, i.e. each property needs to be a key and the associated value either "Ascending" or "Descending" based on the wanted sort order, or "FQLFormula" if you want to use a formula to define the sort order. ```yaml Type: Hashtable