/
Bulk Field Creation
Bulk Field Creation
Overview
The Bulk API allows you to efficiently insert multiple fields into HawkSearch in a single API call, optimizing the performance and reducing the number of round trips to the server. This documentation provides details on how to use the Bulk API to perform bulk insertions.
Request: POST request to the API below:
POST /api/v10/field/bulk HTTP/1.1
Host: dev.hawksearch.net
X-HawkSearch-ApiKey: USE_YOUR_API_KEY
Cache-Control: no-cache
{
"fields": [
{
"FieldId": 0,
"SyncGuid": "00000000-0000-0000-0000-000000000000",
"Name": "brand",
"FieldType": "facet",
"Label": "Brand",
"Type": "String",
"Boost": 1,
"FacetHandler": 0,
"IsPrimaryKey": false,
"IsOutput": true,
"IsShingle": false,
"IsBestFragment": false,
"IsDictionary": false,
"IsSort": false,
"IsPrefix": false,
"IsHidden": false,
"IsCompare": false,
"SortOrder": 0,
"PartialQuery": "",
"IsKeywordText": true,
"IsQuery": false,
"IsQueryText": false,
"SkipCustom": false,
"StripHtml": false,
"MinNGramAnalyzer": 2,
"MaxNGramAnalyzer": 15,
"CoordinateType": 0,
"OmitNorms": false,
"ItemMapping": "",
"DefaultValue": "",
"UseForPrediction": false,
"CopyTo": "",
"Analyzer": "",
"DoNotStore": false,
"Tags": "",
"Iterations": [
1
],
"AnalyzerLanguage": "",
"PreviewMapping": null,
"OmitTfAndPos": false,
"CreateDate": "02-04-2021",
"ModifyDate": "02-04-2021"
},
{
"FieldId": 0,
"SyncGuid": "00000000-0000-0000-0000-000000000000",
"Name": "name",
"FieldType": "facet",
"Label": "Name",
"Type": "String",
"Boost": 1,
"FacetHandler": 0,
"IsPrimaryKey": false,
"IsOutput": true,
"IsShingle": false,
"IsBestFragment": false,
"IsDictionary": false,
"IsSort": false,
"IsPrefix": false,
"IsHidden": false,
"IsCompare": false,
"SortOrder": 0,
"PartialQuery": "",
"IsKeywordText": true,
"IsQuery": false,
"IsQueryText": false,
"SkipCustom": false,
"StripHtml": false,
"MinNGramAnalyzer": 2,
"MaxNGramAnalyzer": 15,
"CoordinateType": 0,
"OmitNorms": false,
"ItemMapping": "",
"DefaultValue": "",
"UseForPrediction": false,
"CopyTo": "",
"Analyzer": "",
"DoNotStore": false,
"Tags": "",
"Iterations": [
1
],
"AnalyzerLanguage": "",
"PreviewMapping": null,
"OmitTfAndPos": false,
"CreateDate": "02-04-2021",
"ModifyDate": "02-04-2021"
},
// Add more fields as needed
]
}
Response: The response will contain a JSON array with the syncGuids of the inserted fields. Each syncGuid represents a unique identifier for the corresponding field added to HawkSearch.
{
[
"11111111-1111-1111-1111-111111111111",
"22222222-2222-2222-2222-222222222222",
// SyncGuids for other fields
]
}
, multiple selections available,
Related content
Using API to Create Fields
Using API to Create Fields
More like this
Using API to Update Fields
Using API to Update Fields
More like this
Hawksearch v4.0 - Search API
Hawksearch v4.0 - Search API
Read with this
Manage Definition
Manage Definition
More like this
Using API to Get FieldId/Name Information
Using API to Get FieldId/Name Information
More like this
Using API to Get Field Information
Using API to Get Field Information
More like this