Share via


New-SPEnterpriseSearchQueryTopology

 

Applies to: SharePoint Server 2010

Topic Last Modified: 2010-05-07

Adds a query topology to a shared search application.

Syntax

New-SPEnterpriseSearchQueryTopology -SearchApplication <SearchServiceApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Clone <SwitchParameter>] [-Clone <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-QueryTopology <QueryTopologyPipeBind>] [-WhatIf [<SwitchParameter>]]

New-SPEnterpriseSearchQueryTopology -SearchApplication <SearchServiceApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Clone <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-Partitions <String>] [-WhatIf [<SwitchParameter>]]

Detailed Description

This cmdlet contains more than one parameter set. You may only use parameters from one parameter set, and you may not combine parameters from different parameter sets. For more information about how to use parameter sets, see Cmdlet Parameter Sets.

The New-SPEnterpriseSearchQueryTopology cmdlet is used when the search functionality is initially configured or when a new query topology is created. A search service application can contain multiple query topologies when a query component or index partition is added to or deleted from a topology.

Parameters

Parameter Required Type Description

SearchApplication

Required

Microsoft.Office.Server.Search.Cmdlet.SearchServiceApplicationPipeBind

Specifies the search application that contains the query topology.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid search application name (for example, SearchApp1); or an instance of a valid SearchServiceApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Clone

Optional

System.Management.Automation.SwitchParameter

Specifies that the new query topology is created by cloning an existing query topology.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Partitions

Optional

System.String

Specifies the number of query partitions to use for the new query topology.

The type must be a valid string that indicates a number less than or equal to 256.

QueryTopology

Optional

Microsoft.Office.Server.Search.Cmdlet.QueryTopologyPipeBind

Specifies the query topology to clone for the new query topology.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh, or an instance of a valid QueryTopology object.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Input Types

Return Types

Example

------------------EXAMPLE------------------

$ssa = GetSPEnterpriseSearchServiceApplication
$qtOld = $ssa | Get-SPEnterpriseSearchQueryTopology -Active
$ssInstance = Get-SPEnterpriseSearchServiceInstance -Local
$qtNew = $ssa | New-SPEnterpriseSearchQueryTopology -Partitions 1 
$idxPartition = (Get-SPEnterpriseSearchIndexPartition -QueryTopology $qtOld)
$queryComponent = New-SPEnterpriseSearchQuerycomponent -QueryTopology $qtNew -IndexPartition $idxPartition -SearchServiceInstance $ssInstance
$qtNew | Set-SPEnterpriseSearchQueryTopology -Active
$qtOld | Remove-SPEnterpriseSearchQueryTopology

This example creates a query topology with a single partition and creates a query component for that topology. It sets the new query topology as the active query topology of a search service application named MySSA, and deletes the old topology.