You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The SagaQueryStage executes a query to Saga and returns the results based on the specified configuration.

PropertyDescriptionDefaultType
typeStage class name
string
enableEnable stage for executiontrueboolean
nameName for this specific stage. Used on the intermediate and final parameters."saga_query"string
save_to_intermediateIf 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.falseboolean
expand_resultIndicates if the result of this stage should be expanded into the final data dictionary instead of being appended as usual.falseboolean
ui_onlySection specific for UI configuration. This configuration will be retrieved when necessary and should affect the process of the stage.objectNo
halt_on_exceptionIndicates if the pipeline should be interrupted in case of an exception during this stage.falseboolean
urlURL to Saga Server"http://localhost:8080"string
unitName of the process unit"sa_query_stage"string
unit_typeType of execution to perform. Refer to the documentation for available unit types."json"UnitType
tagsList of tags to identify in the text
array of strings
processorProcess Id of the pipeline you want to work from. Can only be used if no tags were defined.stringNo
engine_pool_sizeNumber of engines per process unit10integer
create_enginesSpecifies whether the engines should be created at once. If set to false, each engine will be generated as required.falseboolean
engine_timeoutTime in milliseconds for the engine to timeout15000integer
split_regexRegex pattern used to split the text into more manageable blocks to be processed by Saga"[\n\r]+"string (regex)
multilineSpecifies whether the splitRegex should apply on multiple linestrueboolean
max_chars_size_to_processMaximum number of characters to process. If the value is 0, no maximum is applied.0integer
exact_tagsReturn only the exact same tags specified in the "tags" fieldfalseboolean
ignored_tagsList of tags to ignore from the regular processarray of stringsNo
include_flagsList of flags to include in the result, regardless of other configuration[]array of strings
exclude_flagsList of flags to exclude from the results["TEXT_BLOCK"]array of strings
include_metadataInclude the metadata in the tags and verticesfalseboolean
combine_routesSpecifies whether routes of the same confidence should be combined into one routefalseboolean
include_componentsInclude the components (tokens which compose the tag) of each matched tagfalseboolean
include_component_metadataIf components are included, specifies whether the metadata of each component needs to be addedfalseboolean
include_these_componentsList of specific components to add. Any other component will be ignoredarray of stringsNo
expiresSpecifies 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.falseboolean or 

UnitExpiration

refresh_expirationSpecifies whether to refresh the expiration time every time the unit is processedfalseboolean
persistentIf set to true, the process unit will be saved in the database and loaded automatically on server restartfalseboolean
api_keyAPI Key used to authenticate with SagastringNo

UnitType Enum 

Enum ValueDescription
"json"JSON process unit
"matchExtraction"Match extraction process unit
"analytics"Analytics process unit
"route"Route process unit

UnitExpiration Properties 

PropertyDescriptionTypeRequired
amountAmount of time for the expirationintegerYes
time_unitTime unit for the expirationUnitTimeUnitYes

UnitTimeUnit Enum 

Enum ValueDescription
"days"Days
"half_days"Half days
"hours"Hours
"micros"Microseconds
"millis"Milliseconds
"minutes"Minutes
"nanos"Nanoseconds
"seconds"Seconds
"weeks"Weeks




Example Configuration

_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
)
  • No labels