Upload API¶
API operations on uploading files.
-
upload.views.
allowed_file
(filename)[source]¶ Check if the uploading file’s type is allowed.
Parameters: filename – filename Returns: result of the check Return type: bool
-
upload.views.
define_facets
(data)[source]¶ Define facets by their occurrence in the dataset.
Parameters: data – DataFrame
with the uploaded datasetReturns: field names which will be used as facets Return type: list
-
upload.views.
save_uploaded_dataset
()[source]¶ - POST /save_uploaded_dataset/
- Save the ploaded dataset’s settings and start the CompleteSearch server
Parameters: data – a dictionary with all dataset’s settings, which have been generated by the upload_file
function.Returns: dictionary with the success
property and anerror
messageReturn type: JSON response
-
upload.views.
upload_file
()[source]¶ - POST /upload_file/
- Upload, validate and process a file, and send it to CompleteSearch.
Parameters: - use_first_row – use the first data row as a header.
If the parameter is
False
, the column names will be generated automatically (i.e. Column1, Column2, etc.). - file – the uploading file
Returns: dictionary with dataset settings, e.g. facet/filter fields, which fields to use for the full-text search, etc.
Return type: JSON response