The SagaQueryStage executes a query to Saga and returns the results based on the specified configuration.
Property | Description | Default | Type |
---|---|---|---|
type | Stage class name | string | |
enable | Enable stage for execution | true | boolean |
name | Name for this specific stage. Used on the intermediate and final parameters. | "saga_query" | string |
save_to_intermediate | If True, the result of the stage will be stored in the intermediate instead of the final section. This makes the response of the stage unavailable for the final result. | false | boolean |
expand_result | Indicates if the result of this stage should be expanded into the final data dictionary instead of being appended as usual. | false | boolean |
ui_only | Section specific for UI configuration. This configuration will be retrieved when necessary and should affect the process of the stage. | object | No |
halt_on_exception | Indicates if the pipeline should be interrupted in case of an exception during this stage. | false | boolean |
url | URL to Saga Server | "http://localhost:8080" | string |
unit | Name of the process unit | "sa_query_stage" | string |
unit_type | Type of execution to perform. Refer to the documentation for available unit types. | "json" | UnitType |
tags | List of tags to identify in the text | array of strings | |
processor | Process Id of the pipeline you want to work from. Can only be used if no tags were defined. | string | No |
engine_pool_size | Number of engines per process unit | 10 | integer |
create_engines | Specifies whether the engines should be created at once. If set to false, each engine will be generated as required. | false | boolean |
engine_timeout | Time in milliseconds for the engine to timeout | 15000 | integer |
split_regex | Regex pattern used to split the text into more manageable blocks to be processed by Saga | "[\n\r]+" | string (regex) |
multiline | Specifies whether the splitRegex should apply on multiple lines | true | boolean |
max_chars_size_to_process | Maximum number of characters to process. If the value is 0, no maximum is applied. | 0 | integer |
exact_tags | Return only the exact same tags specified in the "tags" field | false | boolean |
ignored_tags | List of tags to ignore from the regular process | array of strings | No |
include_flags | List of flags to include in the result, regardless of other configuration | [] | array of strings |
exclude_flags | List of flags to exclude from the results | ["TEXT_BLOCK"] | array of strings |
include_metadata | Include the metadata in the tags and vertices | false | boolean |
combine_routes | Specifies whether routes of the same confidence should be combined into one route | false | boolean |
include_components | Include the components (tokens which compose the tag) of each matched tag | false | boolean |
include_component_metadata | If components are included, specifies whether the metadata of each component needs to be added | false | boolean |
include_these_components | List of specific components to add. Any other component will be ignored | array of strings | No |
expires | Specifies the expiration time for the process unit. If set to false, the process unit will not expire. If set to a value, the unit will expire after that time. | false | boolean or |
refresh_expiration | Specifies whether to refresh the expiration time every time the unit is processed | false | boolean |
persistent | If set to true, the process unit will be saved in the database and loaded automatically on server restart | false | boolean |
api_key | API Key used to authenticate with Saga | string | No |
Enum Value | Description |
---|---|
"json" | JSON process unit |
"matchExtraction" | Match extraction process unit |
"analytics" | Analytics process unit |
"route" | Route process unit |
Property | Description | Type | Required |
---|---|---|---|
amount | Amount of time for the expiration | integer | Yes |
time_unit | Time unit for the expiration | UnitTimeUnit | Yes |
Enum Value | Description |
---|---|
"days" | Days |
"half_days" | Half days |
"hours" | Hours |
"micros" | Microseconds |
"millis" | Milliseconds |
"minutes" | Minutes |
"nanos" | Nanoseconds |
"seconds" | Seconds |
"weeks" | Weeks |
_saga = SagaQueryStage( enable=True, name='saga_query', url="http://localhost:8080", unit_type=UnitType.JSON, unit='sa_query_stage', tags=["binaryOperator"], processor=None, engine_pool_size=10, create_engines=False, engine_timeout=30000, split_regex='[\\n\\s]+', multiline=True, max_chars_size_to_process=0, exact_tags=False, exclude_flags=['TEXT_BLOCK'], expires=False, refresh_expiration=False, persistent=False, api_key="U2FnYQsU9xGNgOvUxafi-2tV2Jt9FduTCQwxaRVyva58sVpnwR", ignored_tags=None, include_flags=None, include_metadata=True, include_components=True, include_component_metadata=True )