Использование powershell, как удалить свойство synonymMaps в json.
{
"name": "dev-contentitem-text-index",
"defaultScoringProfile": null,
"fields": [
{
"name": "id",
"type": "Edm.String",
"searchable": false,
"filterable": false,
"retrievable": true,
"sortable": false,
"facetable": false,
"key": true,
"indexAnalyzer": null,
"searchAnalyzer": null,
"analyzer": null,
"synonymMaps": ""
},
{
"name": "myvalue",
"type": "Edm.String",
"searchable": false,
"filterable": false,
"retrievable": true,
"sortable": true,
"facetable": false,
"key": true,
"indexAnalyzer": null,
"searchAnalyzer": null,
"analyzer": null,
"synonymMaps": ""
}
]
}
Я пытался удалить synonymMaps, но я потерял имя свойства верхнего уровня и defaultScoringProfile. Мне нужно все это целым, но с удаленным синонимом.
$indexDefinition = Get-Content $storedIndex.FullName
$indexDefinition = ($indexDefinition| ConvertFrom-Json)
$indexDefinition.fields|Select-Object * -ExcludeProperty "*synonymMaps*"