(DI-1802) SAP HANA XS application
Schema
For all subsequent database objects DVD_FILESEARCH schema is used.
Tables
dvd.filesearch::FileIndex.File
File header table where all file definitions are stored.
Field | Key | Type | Description |
---|---|---|---|
id | X | INTEGER | Unique identifier of file automatically assigned during entry creation |
guid | NVARCHAR 32 | Unique identifier of file given by File Indexing agent application | |
name | NVARCHAR 255 | Full name of file (including full path in origin) | |
origin.id | 32 | File origin | |
fileType | 100 | Type of file |
Indexes
Index name | Type | Column name | Reason |
---|---|---|---|
dvd.filesearch::FileIndex.File.GUIDIDX | Index | guid | Data is frequently requested by guid identifier |
dvd.filesearch::FileIndex.FileData
Data that represent content of defined files.
Field | Key | Type | Description |
---|---|---|---|
fileId | X | INTEGER | Unique identifier of file |
rowNum | X | INTEGER | Row number of record |
timestamp | TIMESTAMP | Time stamp of record | |
content | CLOB | String content of record |
Indexes
Index name | Type | Column name | Reason |
---|---|---|---|
_ESH_FULLTEXT_157295#157299 | Full-Text Index | content | Main search functionality is done by this index |
dvd.filesearch::FileIndex.FileOrigin
Origin header table where all origin definition are stored.
Field | Key | Type | Description |
---|---|---|---|
id | X | NVARCHAR 32 | Unique identifier of file origin (i.e. system name where files are coming from) |
name | NVARCHAR 128 | Name of origin | |
host | NVARCHAR 128 | Server host |
Views
dvd.filesearch::FileIndex.FileView
This view is used for listing results of file contents search.
Field | Table | Type | Description |
---|---|---|---|
id | dvd.filesearch::FileIndex.File | INTEGER | Unique identifier of file |
name | dvd.filesearch::FileIndex.File | NVARCHAR 255 | Full name of file (including full path in origin) |
fileType | dvd.filesearch::FileIndex.File | NVARCHAR 100 | Type of file |
originId | dvd.filesearch::FileIndex.FileOrigin | NVARCHAR 32 | File origin |
originName | dvd.filesearch::FileIndex.FileOrigin | NVARCHAR 128 | Name of origin |
originHost | dvd.filesearch::FileIndex.FileOrigin | NVARCHAR 128 | Server host |
rowNum | dvd.filesearch::FileIndex.FileData | INTEGER | Row number of record |
timestamp | dvd.filesearch::FileIndex.FileData | TIMESTAMP | Time stamp of record |
content | dvd.filesearch::FileIndex.FileData | CLOB | String content of record |
Sequences
dvd.filesearch::fileId
Number range of field id for table dvd.filesearch::FileIndex.File
Parameter | Value |
---|---|
Start with | 1000 |
Increment by | 1 |
Minimum value | 1 |
Maximum value | 999999999 |
File indexing service API
File indexing service is implemented using 2 services:
- XS javascript (XSJS) service
- Used for creating files, appending rows, etc.
- XSODATA service
- Used for full-text search in files
- Also possible to create files and rows, but for more convenient API xsjs service is more suitable
Service authorizations
Indexing agent application should use database user with assigned role 'dvd.filesearch.roles::agent'.
Technical information
Paramter | Value |
---|---|
Application namespace | dvd.filesearch.FileIndex |
Service path to oData service | /dvd/filesearch/FileIndex.xsodata |
XSJS service
All request should contain following headers and cookies gathered during initial fetch of X-CSRF-Token token.
Header | Value |
---|---|
X-CSRF-Token | <Fetched token> |
Accept | application/json |
Content-Type | application/json |
addFileRows.xsjs
Script path
/dvd/filesearch/addFileRows.xsjs
Request
HTTP method: POST
Request body content example:
Response
Data are successfully added when response contains HTTP code 2* and response body should look as follows:
deleteFileRows.xsjs
Script path
/dvd/filesearch/deleteFileRows.xsjs
Request
HTTP method: POST
Request body content example:
Where guid is identificator of file in which content should be deleted.
Response
Data are successfully deleted when response contains HTTP code 2* and response body should look as follows:
XSODATA service
We are exposing CDS entities to oData using XSODATA definition file. OData are mainly used by SAPUI5 application.
Table | oData entity | Path |
---|---|---|
dvd.filesearch::FileIndex.FileOrigin | FileOrigin | /dvd/filesearch/FileIndex.xsodata/FileOrigin |
dvd.filesearch::FileIndex.File | File | /dvd/filesearch/FileIndex.xsodata/File |
dvd.filesearch::FileIndex.FileData | FileData | /dvd/filesearch/FileIndex.xsodata/FileData |
dvd.filesearch::FileIndex.FileView | FileView | /dvd/filesearch/FileIndex.xsodata/FileView |
More information about properties can be found from metadata of service.