< Back

Add-AzureSearchDocument

Sat Jan 11, 2020 12:04 pm

NAME Add-AzureSearchDocument



SYNOPSIS

Add new document(s) to the index.





SYNTAX

Add-AzureSearchDocument -InputObject <PSObject> [-IndexName <String>] [-JsonRequest] [-WhatIf] [-Confirm]

[<CommonParameters>]



Add-AzureSearchDocument [-IndexName <String>] [-DocumentData <Hashtable>] [-JsonRequest] [-WhatIf] [-Confirm]

[<CommonParameters>]





DESCRIPTION

The Add-AzureSearchDocument cmdlet lets you add new document(s) to the index.





PARAMETERS

-InputObject <PSObject>

You can pass documents data from pipe.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-IndexName <String>

Azure Search index Name to add documents.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-DocumentData <Hashtable>

Documemtns to be added to the index.



Required? false

Position? named

Default value

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:\\>Add-AzureSearchDocument -IndexName hotels -DocumentData

@{hotelId=01;hotelName="nicerHotel";description="Nice Hotel";rating=1} -Verbose



This example add a document to hotels index.









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



PS C:\\>Import-Csv hoteldata.csv | Add-AzureSearchDocument



This example bulk add documents. Index name will be automatically found from fields information.











RELATED LINKS