Skip to content

Commit

Permalink
Antti/update submitsearchquery docs (#3527)
Browse files Browse the repository at this point in the history
* Update documentation for Submit-PnPSearchQuery

* Changes sentence ending to be consistent 😅

* Document LCIDs used by -Culture switch

* Update Submit-PnPSearchQuery.md

---------

Co-authored-by: Gautam Sheth <[email protected]>
  • Loading branch information
koskila and gautamdsheth authored Oct 22, 2023
1 parent 76e68ad commit 773a4d3
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions documentation/Submit-PnPSearchQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 773a4d3

Please sign in to comment.