< Back

New-AzureSearchIndex

Sat Jan 11, 2020 12:09 pm

NAME New-AzureSearchIndex



SYNOPSIS

Create new Azure Serach index





SYNTAX

New-AzureSearchIndex [-Name] <String> [-Fields] <Object> [-JsonRequest] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

The New-AzureSearchIndex cmdlet lets create new Azure Serach index





PARAMETERS

-Name <String>

Azure Search index Name.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Fields <Object>

Fields to be added to the index. You can use New-AzureSearchField function to create fields.



Required? true

Position? 2

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:\\>$fields= & {



New-AzureSearchField -Name hotelId -Type Edm.String -isKey -Retrievable

New-AzureSearchField -Name baseRate -Type Edm.Double

New-AzureSearchField -Name description -Type Edm.String -Retrievable -Searchable

New-AzureSearchField -Name description_fr -Type Edm.String -Analyzer "fr.lucene" -Searchable

New-AzureSearchField -Name hotelName -Type Edm.String -Retrievable

New-AzureSearchField -Name category -Type Edm.String -Filterable

New-AzureSearchField -Name tags -Type 'Collection(Edm.String)' -Searchable

New-AzureSearchField -Name parkingINcluded -Type Edm.Boolean

New-AzureSearchField -Name smokingAllowed -Type Edm.Boolean

New-AzureSearchField -Name lastRenovationDate -Type Edm.DateTimeOffset

New-AzureSearchField -Name rating -Type Edm.Int32 -Filterable

New-AzureSearchField -Name location -Type Edm.GeographyPoint

}

New-AzureSearchIndex -Name hotels -Fields $fields -Verbose



This example creates an index with 12 fields.











RELATED LINKS