compass.web.search.record_search_attempt#

async record_search_attempt(engine, query, num_results, results, error, seconds)[source]#

Record one search engine’s answer to one query in the event log

Passed to ELM as its on_search_hook, which calls it after every search attempt, including those that fail (e.g. on a timeout). Nothing is recorded without an active event log.

Parameters:
  • engine (elm.web.search.base.SearchEngineLinkSearch) – Search engine instance that ran the query.

  • query (str) – Query that was searched.

  • num_results (int) – Number of results requested.

  • results (list or None) – Results returned, or None if the search raised an error.

  • error (Exception or None) – Error raised by the search, if any.

  • seconds (float) – How long the attempt took.