hansken_extraction_plugin.api.trace_searcher

This module contains the definition of a trace searcher.

Classes

SearchScope(value)

Scope to describe the search context for TraceSearcher.search calls.

TraceSearcher()

This class can be used to search for traces, using the search method.

class SearchScope(value)[source]

Bases: str, Enum

Scope to describe the search context for TraceSearcher.search calls.

image = 'image'
project = 'project'
class TraceSearcher[source]

Bases: object

This class can be used to search for traces, using the search method.

abstract search(query: str, count: int, scope: str | SearchScope = SearchScope.image) SearchResult[source]

Search for indexed traces in Hansken using provided query returning at most count results.

Parameters:
  • query – HQL-query used for searching

  • count – Maximum number of traces to return

  • scope – Select search scope: ‘image’ to search only search for other traces within the image of the trace that is being processed, or ‘project’ to search in the scope of the full project (either Scope- enum value can be used, or the str-values directly).

Returns:

SearchResult containing found traces