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 ] }