...
Info |
---|
Important: Depending on the version of HawkSearch and the method of integration you are using, you may need to perform indexing as per Hawksearch - Elasticsearch Version- Indexing API. Please contact HawkSearch for any clarifications. |
Overview
This API allows you to create a field trigger an index rebuild job in Hawksearch dashboard and manage the field configurations.
Example use case: Create a Brand field that can be used as a facet filter.
Request: POST request with empty body to the API below:
Code Block | ||
---|---|---|
| ||
POST /api/v9/fieldindex HTTP/1.1 Host: manage.hawksearch.com X-HawkSearch-ApiKey: USE_YOUR_API_KEY Cache-Control: no-cache Postman-Token: cd457184-4c00-a650-62f2-530f22a9a384 { "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" } |
Response: The response is an array of field string objects, every field object being a series of key-value pairs. Description of the data is as follows:
No | Key | Description | Value Type | ||
---|---|---|---|---|---|
1 | FieldIdNotificationId | The unique identifier of the field (unique across the whole system)asssigned to the index rebuild request made | Number | ||
2 | SyncGuidTitle | Internal fieldTask name | GUID | ||
3 | Name | Name unique to an engine (can be the same for one or more engines) | lowercase alphanumeric string with underscores allowed | ||
4 | FieldType | One of the below field configuration options: Field Values are NOT stemmed | One of the 4 possible values - facet keywordtext | ||
5 | Label | Display name of the field | Alphanumeric string | ||
6 | Type | Datatype of the field | One of the 3 possible values - String, Single, Boolean, Datetime, GeoPoint | ||
7 | Boost | Boost value set on the field | Number between 1 and 200, inclusiveString Example: Requested Re-Indexing (API) | ||
3 | Message | Response message from the server | String Example: Requested Re-Indexing (API) | ||
4 | NotificationType | Indicates whether this was indexing related or not | String Example: indexing | ||
5 | Status | The current indexing status | One of the 8 possible values: new, pending, processing, queue, success, error, duplicated, suspended | ||
6 | AdminId | Admin account id from which the index rebuild request was raised | Numeric | ||
7 | Provider | Indexing provider - this is debugging info used by HawkSearch | Alphanumeric | ||
8 | FacetHandler | Internal handler associated with the field | Alphanumeric | ||
9 | IsPrimaryKey | Flag to set as primary field | BooleanSerialized | Serialized object | Alphanumeric |
10 | IsOutput | Flag to control presence in response | Boolean | ||
11 | IsShingle | Corresponds to Add phrases to "Did you Mean"? under the field settings on the dashboard | Boolean | ||
12 | IsBestFragment | Flag controls creating synopses for large textual content | Boolean | ||
13 | IsDictionary | Flag to include field for autocorrect suggestions | Boolean | ||
14 | IsSort | Flag to allow sorting on search results page | Boolean | ||
15 | IsPrefix | Flag to indicate if the field is a prefix type | Boolean | ||
16 | IsHidden | Flag to control query builder configuration for the field | Boolean | ||
17 | IsCompare | Flag to manage comparison display | Boolean | ||
18 | SortOrder | Sort order of the field | Numeric | ||
19 | PartialQuery | Query type for the field | None, Prefix or Wildcard | ||
20 | IsKeywordText | Indicates that the field values indexed ""as is"" AND are stemmed | Boolean | ||
21 | IsQuery | Flag to allow querying on the field | Boolean | ||
22 | IsQueryText | Flag to show query text value | Boolean | ||
23 | SkipCustom | Flag to control display in custom group | Boolean | ||
24 | StripHtml | Flag to remove html content | Boolean | ||
25 | MinNGramAnalyzer | Minimum value for ngram analyzer (for queryable fields) | Numeric, 2 to 15 inclusive | ||
26 | MaxNGramAnalyzer | Maximum value for ngram analyzer (for queryable fields) | Numeric, 2 to 15 inclusive | ||
27 | CoordinateType | Used for latitude and logitude | Alphanumeric | ||
28 | OmitNorms | Flag to enable/disable smaller document to score higher | Boolean | ||
29 | ItemMapping | Field mapping value | Fieldname | ||
30 | DefaultValue | Value to show when empty | Alphanumeric | ||
31 | UseForPrediction | Flag to indicate that field is used in Recs | Boolean | ||
32 | CopyTo | List of fields to copy values into (redundancy) | List of alphanumeric fieldnames | ||
33 | Analyzer | Corresponds to the drop down list of Analyzers to be chosen | Alphanumeric | ||
34 | DoNotStore | Flag to control storage (helps to increase performance by reducing index size) | Boolean | ||
35 | Tags | Engine-wide labels (avilable acros complete dashboard) | Comma separated alphanumeric string | ||
36 | Iterations | Query iterations | Array of numeric values | ||
37 | AnalyzerLanguage | Natural language choice for query analyzer | Alphanumeric | ||
38 | PreviewMapping | Available for API indexing enabled engines | Fieldname | ||
39 | OmitTfAndPos | Flag to omit term frequency | Boolean | ||
40 | CreateDate | Field creation date | Date string in MM-DD-YYYY format | ||
41 | ModifyDate | Field modification date | Date string in MM-DD-YYYY format | ||
ErrorMessages | Error messages associated with the rebuild job | Alphanumeric |
Code Block | ||
---|---|---|
| ||
{ "FieldIdNotificationId": 479976122924, "SyncGuidTitle": "1a0db291-d004-4cfa-a894-1ac8cadbe110", "Name": "Brand"Requested Re-Indexing (API)", "FieldTypeMessage": "facet", "Label": "brand"Requested Re-Indexing (API)", "TypeNotificationType": "Stringindexing", "BoostStatus": 1, "FacetHandlernew": 0, "IsPrimaryKeyAdminId": false113, "IsOutputProvider": true, "IsShingle": falseContracts.IndexNotification", "IsBestFragmentSerialized": false, "IsDictionary": falseCgsIhuSGoufqtzkQBRIECAEQDyIuChJSZXF1ZXN0ZWQgSW5kZXhpbmcSCwiG5Iai5+q3ORAFGgsIhuSGoufqtzkQBQ==", "IsSort": false, "IsPrefix": false, "IsHidden": false, "IsCompare": false, "SortOrder": 11, "PartialQuery": "", "IsKeywordText": false, "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": null, "PreviewMapping": null, "OmitTfAndPos": false, "CreateDate": "03-08-2021", "ModifyDate": "03-08-2021" ErrorMessages": null } |
Please review : Best Practices to Create Fieldrebuild index