Skip to content

Latest commit

 

History

History
406 lines (313 loc) · 8.74 KB

Submit-PnPSearchQuery.md

File metadata and controls

406 lines (313 loc) · 8.74 KB
external help file applicable schema
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online
2.0.0

Submit-PnPSearchQuery

SYNOPSIS

Executes an arbitrary search query against the SharePoint search index

SYNTAX

Limit

Submit-PnPSearchQuery -Query <String>
                      [-StartRow <Int>]
                      [-MaxResults <Int>]
                      [-TrimDuplicates <Boolean>]
                      [-Properties <Hashtable>]
                      [-Refiners <String>]
                      [-Culture <Int>]
                      [-QueryTemplate <String>]
                      [-SelectProperties <String[]>]
                      [-RefinementFilters <String[]>]
                      [-SortList <Hashtable>]
                      [-RankingModelId <String>]
                      [-ClientType <String>]
                      [-HiddenConstraints <String>]
                      [-TimeZoneId <Int>]
                      [-EnablePhonetic <Boolean>]
                      [-EnableStemming <Boolean>]
                      [-EnableQueryRules <Boolean>]
                      [-SourceId <Guid>]
                      [-ProcessBestBets <Boolean>]
                      [-ProcessPersonalFavorites <Boolean>]
                      [-RelevantResults [<SwitchParameter>]]
                      [-Web <WebPipeBind>]
                      [-Connection <SPOnlineConnection>]

All

Submit-PnPSearchQuery -Query <String>
                      [-All [<SwitchParameter>]]
                      [-TrimDuplicates <Boolean>]
                      [-Properties <Hashtable>]
                      [-Refiners <String>]
                      [-Culture <Int>]
                      [-QueryTemplate <String>]
                      [-SelectProperties <String[]>]
                      [-RefinementFilters <String[]>]
                      [-SortList <Hashtable>]
                      [-RankingModelId <String>]
                      [-ClientType <String>]
                      [-HiddenConstraints <String>]
                      [-TimeZoneId <Int>]
                      [-EnablePhonetic <Boolean>]
                      [-EnableStemming <Boolean>]
                      [-EnableQueryRules <Boolean>]
                      [-SourceId <Guid>]
                      [-ProcessBestBets <Boolean>]
                      [-ProcessPersonalFavorites <Boolean>]
                      [-RelevantResults [<SwitchParameter>]]
                      [-Web <WebPipeBind>]
                      [-Connection <SPOnlineConnection>]

EXAMPLES

------------------EXAMPLE 1------------------

PS:> Submit-PnPSearchQuery -Query "finance"

Returns the top 500 items with the term finance

------------------EXAMPLE 2------------------

PS:> 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

------------------EXAMPLE 3------------------

PS:> Submit-PnPSearchQuery -Query "Title:Intranet*" -All

Returns absolutely all items indexed by SharePoint Search of which the title starts with the word Intranet

------------------EXAMPLE 4------------------

PS:> 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

PARAMETERS

-All

Automatically page results until the end to get more than 500. Use with caution!

Type: SwitchParameter
Parameter Sets: All

Required: False
Position: Named
Accept pipeline input: False

-ClientType

Specifies the name of the client which issued the query.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Culture

The locale for the query.

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnablePhonetic

Specifies whether the phonetic forms of the query terms are used to find matches.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableQueryRules

Specifies whether Query Rules are enabled for this query.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableStemming

Specifies whether stemming is enabled.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-HiddenConstraints

The keyword query’s hidden constraints.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-MaxResults

Maximum amount of search results to return. Default and max per page is 500 search results.

Type: Int
Parameter Sets: Limit

Required: False
Position: Named
Accept pipeline input: False

-ProcessBestBets

Determines whether Best Bets are enabled.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ProcessPersonalFavorites

Determines whether personal favorites data is processed or not.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Properties

Extra query properties. Can for example be used for Office Graph queries.

Type: Hashtable
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Query

Search query in Keyword Query Language (KQL).

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-QueryTemplate

Specifies the query template that is used at run time to transform the query based on user input.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RankingModelId

The identifier (ID) of the ranking model to use for the query.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RefinementFilters

The set of refinement filters used.

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Refiners

The list of refiners to be returned in a search result.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RelevantResults

Specifies whether only relevant results are returned

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SelectProperties

The list of properties to return in the search results.

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SortList

The list of properties by which the search results are ordered.

Type: Hashtable
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SourceId

Specifies the identifier (ID or name) of the result source to be used to run the query.

Type: Guid
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-StartRow

Search result item to start returning the results from. Useful for paging. Leave at 0 to return all results.

Type: Int
Parameter Sets: Limit

Required: False
Position: Named
Accept pipeline input: False

-TimeZoneId

The identifier for the search query time zone.

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TrimDuplicates

Specifies whether near duplicate items should be removed from the search results.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by cmdlet. Retrieve the value for this parameter by eiter specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: SPOnlineConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

List<System.Object>

RELATED LINKS

SharePoint Developer Patterns and Practices