Share via


QueryComponentCollection.Create Method

Creates a new query component using the specified parameters.

Namespace:  Microsoft.Office.Server.Search.Administration
Assembly:  Microsoft.Office.Server.Search (in Microsoft.Office.Server.Search.dll)

Syntax

'Declaration
Public Function Create ( _
    serviceInstance As SearchServiceInstance, _
    indexLocation As String, _
    partition As IndexPartition, _
    failoverOnly As Boolean, _
    customShareName As String _
) As QueryComponent
'Usage
Dim instance As QueryComponentCollection
Dim serviceInstance As SearchServiceInstance
Dim indexLocation As String
Dim partition As IndexPartition
Dim failoverOnly As Boolean
Dim customShareName As String
Dim returnValue As QueryComponent

returnValue = instance.Create(serviceInstance, _
    indexLocation, partition, failoverOnly, _
    customShareName)
public QueryComponent Create(
    SearchServiceInstance serviceInstance,
    string indexLocation,
    IndexPartition partition,
    bool failoverOnly,
    string customShareName
)

Parameters

  • indexLocation
    Type: System.String

    The full file path to the index file.

  • failoverOnly
    Type: System.Boolean

    true if the query component will be used strictly for failover; otherwise, false.

  • customShareName
    Type: System.String

    The name of a file share for the destination index files, which must be the same as the indexLocation parameter.

    This value can be null, in this case a default share name will be used.

Return Value

Type: Microsoft.Office.Server.Search.Administration.QueryComponent
The query component that was created.

Remarks

This method does not guarantee immediate availability of the new query component in the Search service application.

An ArgumentNullException is thrown if the values of the serviceInstance or partition parameters are null.

See Also

Reference

QueryComponentCollection Class

QueryComponentCollection Members

Microsoft.Office.Server.Search.Administration Namespace