< Back

Merge-AzureSearchDocument

Sat Jan 11, 2020 12:07 pm

NAME Merge-AzureSearchDocument



SYNOPSIS

Update existing document in the index.





SYNTAX

Merge-AzureSearchDocument [-IndexName] <String> [[-DocumentData] <Hashtable>] [-MergeOrUpload] [-JsonRequest]

[-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

The Merge-AzureSearchDocument cmdlet lets you update existing document in the index





PARAMETERS

-IndexName <String>

Azure Search index Name to add documents.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-DocumentData <Hashtable>

Documemtns to be added to the index.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-MergeOrUpload [<SwitchParameter>]

When specified, it behaves like merge if a document with the given key already exists in the index. If the

document does not exist, it adds a new document.

If not specified and no matching document exists, it fails.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-JsonRequest [<SwitchParameter>]

When specified, result is returned as json object.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



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



PS C:\\>Merge-AzureSearchDocument -IndexName hotels -DocumentData @{hotelId=01;name="nicerHotel";description="Nice

Hotel";rating=1}



This example update a document with hotelId 01 with new value. If no such document, it fails.









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



PS C:\\>Merge-AzureSearchDocument -IndexName hotels -DocumentData @{hotelId=01;name="nicerHotel";description="Nice

Hotel";rating=1} -MergeOrUpload



This example update a document with hotelId 01 with new value. If no such document, it adds new document.











RELATED LINKS