logo

English

Autocomplete Feedback

Use this API when a user hits an autocomplete suggestion.
GET /api/v1/{project}/collections/{collection}/autocomplete/feedback/hits
OR
POST /api/v1/{project}/collections/{collection}/autocomplete/feedback/hits
OR
GET /api/v1/{project}/collections/{collection}/autocomplete/{handler}/feedback/hits
OR
POST /api/v1/{project}/collections/{collection}/autocomplete/{handler}/feedback/hits
Where:
  1. {project} is your project name, e.x wptest.
  2. {collection} is the name of collection of documents you want to search in, e.x posts.
  3. {handler} is the autocomplete handler, set it to suggest if you have not created your own custom search handler.

Querystring parameters (Body if POST):

  1. query: the search query, e.x ?query=lableb.
  2. item_id: the id of the clicked suggestion if the suggestion type is navigational, e.x ?item_id=1.
  3. item_order: the index of the clicked suggestion starting from 1, e.x ?item_order=2.
  4. url: the url of the clicked suggestion, e.x ?url=http://mysite.com/posts/clicked-document.
  5. session_id: a unique identifier for a user session, e.x ?session_id=1xHsxW342.
  6. user_id: a unique identifier for a user, e.x ?user_id=1.
  7. user_ip: user ip address, e.x ?user_ip=192.111.24.21.
  8. user_country: user country code, e.x ?user_country=DE.

Example request:

https://api-bahuth.lableb.com/api/v1/wptest/collections/posts/autocomplete/suggest/feedback/hits
  ?query=lableb
  &item_id=1
  &item_order=2
  &url=http://mysite.com/posts/lableb-post
  &session_id=1c4Hb23
  &token=qxDFI791xxxx-8wmxIBIONYiEK44PGnxxxxxx

Example response:

{
  "time": 6,
  "code": 200,
  "response": null
}