Upload Data to a PaF - ABO - Reference Guides

Back Office Integration Guide

Product
ABO
AFS_Version
7.11
Category
Reference Guides
language
English
audience
public

This API allows users to send data to process to a PaF. The PaF must be data-driven, see Data-driven for more information.

This PaF is automatically launched if it is installed in autostart mode. It has to be manually launched if it is installed in manual start mode.

See also:

  • the PaF manager section of AFS Configuration Guide for more information about installing PaF
  • Launch PaF API to launch a manual start PaF

An "Upload Data to a PaF" API request takes the following form:

curl -H Expect: --form file1="@/home/user_name/my_file_to_process.zip" --form file2="@/home/user_name/my_other_file_to_process.zip" "https://$HOST/bo-ws/service/$SERVICE_ID/instance/$SERVICE_STATUS/paf/$PAF_NAME/upload?afs:login=login://$USER:$PASSWORD@$AUTHENTICATION_AUTHORITY&afs:comment=$MY_COMMENT&afs:type=$UPLOAD_TYPE"&afs:priority=LOW|REGULAR|HIGH

Method

POST

The list of parameters and their possible values are enumerated below.

Parameter

Description

file1, file2, ...

Files to upload

$HOST

The server hosting the Back Office

$SERVICE_ID

The number of the desired service

$SERVICE_STATUS

The status of the desired service

$PAF_NAME

The name of the PaF

$MY_COMMENT

The optional comment to set to this upload

$UPLOAD_TYPE

The type of the upload: incremental (or incr), full, or urgent_full (optional, defaults to incremental)

afs:priority

The priority level of the upload: LOW, REGULAR (default), or HIGH.

afs:pafParams

Optional

It expects the following JSON string:

{
"search_build_params": {"processing_type": "full|incr"}
"doc_index_params": {"processing_type": "full|incr"}
"lexicon_params": {"processing_type": "full|incr"}
}

Where:

  • search_build_params applies to the afs_search_build filter.
  • doc_index_params applies to the afs_doc_index filter.
  • lexicon_params resets all the lexicon databases if processing_type is set to full (facet taxonomies, word lexicon, analyzer and facet configuration, facet statistics, "compiled" thesaurus)
  • "processing_type"="full|incr" defines if the upload must behave as a full or incremental upload.

It is worth mentioning that only the following combinations are relevant:

  • When a PaF does not include an afs_doc_index filter

{
"search_build_params": {"processing_type": "full"}
}

  • When a PaF does not expect changes in lexicon databases

{
"search_build_params": {"processing_type": "full"}
"doc_index_params": {"processing_type": "full"}
}

  • When a PaF expects changes in lexicon databases (e.g. a facet with the same name but a different type)

{
"search_build_params": {"processing_type": "full"}
"doc_index_params": {"processing_type": "full"}
"lexicon_params": {"processing_type": "full"}
}

To make sure the lexicon databases do not store unneeded values, thus consume excessive amount of memory, it is useful and recommended to perform a reindex after a significant amount of documents have been deleted.

When setting an afs:priority, the PaF Manager configuration requires adjustments.
See afs:priority Requirements.

Return Example

Return contains UUID, JobID and started attributes.

<?xml version="1.0" standalone='yes'?>
<afs:value xsi:schemaLocation="http://ref.antidot.net/v7/bo/output http://ref.antidot.net/v7.4/bo/output.xsd"
xsi:type="afs:ws.response"
xmlns:afs="http://ref.antidot.net/v7/bo/output"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<afs:query xsi:type="afs:ws.response.query">
<afs:locale>*</afs:locale>
<afs:parameters></afs:parameters>
<afs:properties xsi:type="afs:dynamic"></afs:properties>
</afs:query>
<afs:result xsi:type="afs:PushPafContentReply">
<afs:jobId>186</afs:jobId>
<afs:started>true</afs:started>
<afs:uuid>80385fe4-5d16-4183-816c-427eb9d890ec</afs:uuid>
</afs:result>
</afs:value>

CURL is used for these examples. Any other HTTP client can be used.