Generate Signals

Use the Signals API to generate signals.

Generate signals

When a user clicks on a result, the UI can post signal information to the Signals API endpoint (/api/v1/activity/queries).

Makeup of a signal post

A signal post has these parts:

  • A Search API key – Site Search uses the Search API key to authorize the receipt of the signal.

  • HTTP request header – An X-API-Key request header contains the Search API key.

  • REST verb – The Signals API uses the REST verb POST.

  • Search API endpoint – Search uses the Signals REST endpoint for the Signals API.

  • Request parameters – These parameters specify what to search for and which results to return.

HTTP request header

An HTTP request for the Signals API must contain the X-API-Key header, a custom HTTP header to contain the Search API key (which is also used for the Signals API).

REST verb

The REST verb for signals is POST.

Signals API endpoint

The URI of the Search API endpoint is:

/api/v1/activity/queries

You append this URI to the end of the URL for the Site Search app (everything through pathname):

https://subdomain.lucidworks.cloud/pathname/api/v1/activity/queries

Request parameters

Specify signal information by including parameters in the URL query string of a signal post.

These are the available parameters.

Parameter Description and example Type

path

Everything after the protocol of the web page on which the user generated the signal. For example, /shop.html?item=12987 if the full URL is https://mycorp.com/shop.html?item=12987

string

none

pageTitle

Title of the page from which the signal is sent

string

q

Query term the user entered

q=fusion server

string

rpp

Results per page

rpp=10

integer

p

Page of results on which the signal was generated

p=6

integer

fi

List of fields that were used in the query

fi=id,department,description,price

Note
If a parameter value contains a reserved character, URL encode the character. You might also need to encode other characters. For example, a query parameter for fusion server would be q=fusion%20server or q=fusion+server.

Example

POST https://edfenergy.lucidworks.cloud/search/api/v1/activity/queries

{
  "path":"edfenergy.com/path/to/website",
  "pageTitle":"All about Energy | Edfenergy",
  "query": {
    "q":"",
    "p":"1",
    "rpp":"10",
    "fi": "name,url,description,path_1,detail_url,job_title,email,address,company_name,created_at,created_by,modified_at,modified_by,type,file_extension,file_size"
  }}