New-SPEnterpriseSearchQueryKeyword

 

Applies to: SharePoint Server 2010

Topic Last Modified: 2010-02-11

Adds a keyword term to a shared search application.

Syntax

New-SPEnterpriseSearchQueryKeyword [-Term] <String> -Site <SPSitePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Contact <String>] [-Definition <String>] [-EndDate <Nullable>] [-ReviewDate <Nullable>] [-StartDate <Nullable>] [-WhatIf [<SwitchParameter>]]

Detailed Description

The New-SPEnterpriseSearchQueryKeyword cmdlet changes query results by creating a new keyword. A query keyword is a query component of a query topology. SPEnterpriseSearchQueryKeyword represents relevance setting through keywords.

Parameters

Parameter Required Type Description

Term

Required

System.String

Specifies the keyword term to create.

The type must be a valid string that contains a keyword term (for example, KeywordTerm1).

Site

Required

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Associates the new keyword term to the specified results URL.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid URL, in the form http://server_name; or an instance of a valid SPSite 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.

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

Contact

Optional

System.String

Specifies the user name associated with the new keyword.

The type must be a valid user name; for example, KeywordUser1.

Definition

Optional

System.String

Specifies the definition of the new keyword term.

The type must be a valid string; for example, a keyword term definition.

EndDate

Optional

System.Nullable

Specifies the expiration date of the keyword term. The default value is MaxDate.

The type must be a valid DateTime type, in the form 2010,12,05.

ReviewDate

Optional

System.Nullable

Specifies the review date of the keyword term. The default value is MaxDate.

The type must be a valid date, in the form 2010,12,05.

StartDate

Optional

System.Nullable

Specifies the activation date for the keyword term. The default value is the current date.

The type must be a valid date, in the form 2010,12,05.

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

New-SPEnterpriseSearchQueryKeyword -Term Tangible -Site http://myserver/sites/team

This example creates a new query keyword for the site http://myserver/sites/team with the term Tangible.