Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This document helps to cover some basic questions when we try to add a new field via API.

REST URL: https://test.hawksearch.net/api/v9/Field

Method: POST

Authentication: Basic (Engine API Key)

  1. When creating a new field, you need to make sure that the following fields are always sent in the request payload otherwise the request would be invalid.

2. Please make sure that the field ‘Name’ is unique and a field with the same name does not exist already. You can first get a list of all fields using ‘/api/v9/FieldInfo’ or get this particular field information using field name 'api/v9/Field?fieldName={fieldName}' before creating a new field

3. The ‘Fieldtype can only have one of the 4 possible values:

  • facet

  • keyword

  • unindexed

  • text

Please read more about it here: Best Practices for Field Configuration

4. Multiple can have the same ‘Label’ value as long as the Name is unique.

5. Boost has to be set to 1 when IsQuery=false

6. IsPrimaryKey should be always set to ‘false’ unless you want to mark that field as a Primary Key. Note that only one field can be a Primary key and it is suggested to NOT change it often as it might have a negative impact on site functionality. Please contact Hawksearch if you would like to change the Primary key.

7. IsOutput should be set to ‘true’ only if you need the field value in the search response. Please always set it to ‘false’ if not in use.

8. IsShingle corresponds to Add phrases to "Did you Mean"? under the field settings on the dashboard.

  • It has to be set to false when IsQuery=false.

  • If IsQuery=true, then IsShingle can be set to true only for "Type": "string". You can not use it for types ‘Numeric’ or ‘Boolean’.

  • If IsQuery=true, then IsShingle can be set to true only for "FieldType": "facet", “keyword” and ”keywordtext”. You can not use it for field types ‘unindexed’, ‘text’.

{keywordtext, "Field values indexed ""as is"" AND are stemmed"},
{keyword, "Field values are NOT stemmed"},
{text, "Field values are ONLY stemmed (search only)"},
{unindexed, "Stored only, not used for search nor facets"},
{facet, "Field values are NOT stemmed"}} >> The field type value changes to ‘facet’ from ‘keyword’ if you set up this field as a facet. For fields that will be used as facet, please set up field type as ‘facet’.

  • No labels