Field-specific Search
Please note: we recommend using this post as an initial reference for the newer article field-specific search for V2 field schema which also supports querying datetime and the SIM feature.
General keyword-based search scans all the fields in Hawksearch marked as query-able. However sometimes in situations where we already know the field to be searched for, or would like to customize the search option to target a specific field alone, we can use the query filtering option to specify the field to be searched against.
Notes:
This can be used for fields which are not marked as query-able also.
Errors in this query field value are ignored, please double check your query if the result is not as expected.
This is equivalent to the Hawksearchable parameter used in Hawksearch versions 2.0L to 4.0L.
The format of this query parameter is “fieldname” : ”value”
Examples:
The URL endpoints are available here - Hawksearch v4.0 - Search API
Specifying the field name in the “query” parameter:
POST /api/v2/search { "keyword" : "", "query" : "group_id: 123", "clientguid" : "SPECIFY YOUR CLIENT GUID HERE" }
Use query parameter with the normal search:
POST /api/v2/search { "keyword" : "perfect", "query" : "group_id: 123", "clientguid" : "SPECIFY YOUR CLIENT GUID HERE" }
Use query parameter with the operators AND, OR, NOT:
POST /api/v2/search { "keyword" : "perfect", "query" : "group_id: 123 or 456", "clientguid" : "SPECIFY YOUR CLIENT GUID HERE" }
Complex query parameter with multiple fields and the operators AND, OR, NOT:
Query parameter with TO (range between two values)
Query parameter with Math (numeric values)
This feature is also available on Hawksearch’s Autocomplete API:
Please note that the keyword is required for autocomplete request.Use query parameter with EXISTS operator to check for values: