Commit dda33bc8 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

feat: extend specs, stick to style

parent bf384492
......@@ -44,10 +44,14 @@ The version number will be applied according to [Semantic Versioning 2.0.0](http
| URI | a valid URI, see [URI Syntax](#uri-syntax) |
| int | a non-negative Integer value |
#### URI Syntax
The URI Syntax is used according to the one described at [IIIF](https://iiif.io/api/image/2.1/#uri-syntax).
## About this SearchAPI
The used query syntax and objects are prepared alike [Elasticsearch`s Search API](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html), but
The used query syntax and objects are prepared alike [Elasticsearch\`s Search API](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html) (v7.13), but
not completely similar.
This API is a standalone development especially for the Ahiqar project.
......@@ -61,14 +65,25 @@ This API is a standalone development especially for the Ahiqar project.
| Field Name | Cardinality | Type | Description |
|----|----|----|----|
| query.simple_query_string.query | 1 | string | search query see [query string rules](#query-string-rules) and [Lucene syntax](https://lucene.apache.org/core/8_9_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package.description) |
| from | 1 | int | start item in response |
| query | 1 | [Simple Query String Object](#simple-query-string-object) | main object for setting up the query |
| from | 1 | int | zero-based index of start item in response |
| size | 1 | int | number of hits to return |
### Query String Rules
### Simple Query String Object
| Field Name | Cardinality | Type | Description |
|----|----|----|----|
| simple_query_string | 1 | [Query String Object](#query-string-object) | main query object |
#### Query String Object
| Field Name | Cardinality | Type | Description |
|----|----|----|----|
| query | 1 | string | search query see [query string rules](#query-string-rules) and [Lucene syntax](https://lucene.apache.org/core/8_9_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package.description) |
##### Query String Rules
* An empty query string is not allowed.
* Wildcard only seach is not allowed.
* Multiple terms separated by whitespace.
* Multiple terms are separated by whitespace.
* A whitespace character as term deliminator is equal to ` AND ` by the implementation.
* Leading wildcard is possible.
......@@ -90,24 +105,24 @@ This API is a standalone development especially for the Ahiqar project.
| Field Name | Cardinality | Type | Description |
|----|----|----|----|
| hits | 1 | \[[Hits Object](#hits-object)\] | search result hits |
| took | 1 | int | time in ms search execution took back end side |
| took | 1 | int | time in ms search execution took on back end side |
### Hits Object
| Field Name | Cardinality | Type | Description |
|----|----|----|----|
| total | 1 | [Total Object](#total-object) | properties of the hit list |
| hits | 1 | \[[Hits Array(#hits-array)]\] | sequence of hits (ordered by score) |
| hits | 1 | \[[Hits Array](#hits-array)\] | sequence of hits (ordered by score) |
#### Total Object
| Field Name | Cardinality | Type | Description |
|----|----|----|----|
| value | 1 | int | number of total hits |
| relation | 1 | string | `eq` (from Elasticsearch) |
### Hits Array
This describes a single object form the `hits` array that MUST be present but is MAY be empty.
This describes a single object from the `hits` array that MUST be present but MAY be empty.
| Field Name | Cardinality | Type | Description |
|----|----|----|----|
......@@ -121,7 +136,8 @@ This describes a single object form the `hits` array that MUST be present but is
{
"hits": {
"total": {
"value": 2
"value": 2,
"relation": "eq"
},
"hits" : [ {
"item": "/api/textapi/ahikar/syriac/3r678-186v/latest/item.json",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment