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

  1. Specifying the field name in the “query” parameter:

    POST /api/v2/search { "keyword" : "", "query" : "group_id: 123", "clientguid" : "SPECIFY YOUR CLIENT GUID HERE" }

     

  2. Use query parameter with the normal search:

    POST /api/v2/search { "keyword" : "perfect", "query" : "group_id: 123", "clientguid" : "SPECIFY YOUR CLIENT GUID HERE" }

     

  3. 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" }

     

  4. Complex query parameter with multiple fields and the operators AND, OR, NOT:

     

  5. Query parameter with TO (range between two values)

     

  6. Query parameter with Math (numeric values)

     

  7. This feature is also available on Hawksearch’s Autocomplete API:
    Please note that the keyword is required for autocomplete request.

     

  8. Use query parameter with EXISTS operator to check for values: