Commit 6a3c51fa authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

feat: match object with number of matches in scope

parent eb48b7b8
...@@ -131,7 +131,15 @@ This describes a single object from the `hits` array that MUST be present but MA ...@@ -131,7 +131,15 @@ This describes a single object from the `hits` array that MUST be present but MA
| item | 1 | URI | path to the item context, w/o base uri | | item | 1 | URI | path to the item context, w/o base uri |
| label | 1 | string | label of the manifest [see TextAPI](../text-api-specs/#manifest-object) | | label | 1 | string | label of the manifest [see TextAPI](../text-api-specs/#manifest-object) |
| n | 1 | string | page number as in `tei:pb/@n` [see TextAPI](../text-api-specs/#item-object) | | n | 1 | string | page number as in `tei:pb/@n` [see TextAPI](../text-api-specs/#item-object) |
| match | 1 | [ ] | array of matched strings according to the search terms (useful to present matches when using wildcards). Cannot be empty by definition. | | matches | 1 | [ [match object](#match-object) ] | array of matched strings according to the search terms (useful to present matches when using wildcards). Cannot be empty by definition. |
#### Match Object
| Field Name | Cardinality | Type | Description |
|----|----|----|----|
| term | 1 | string | exact matched word or phrase |
| occurencesOnPage | 1 | number | number of occurences of this exact match in scope (page) |
### Sample Response ### Sample Response
...@@ -146,12 +154,25 @@ This describes a single object from the `hits` array that MUST be present but MA ...@@ -146,12 +154,25 @@ This describes a single object from the `hits` array that MUST be present but MA
"item": "/api/textapi/ahikar/syriac/3r678-186v/latest/item.json", "item": "/api/textapi/ahikar/syriac/3r678-186v/latest/item.json",
"label": "Cod. Arab. 236 Copenhagen", "label": "Cod. Arab. 236 Copenhagen",
"n": "123v", "n": "123v",
"match": [ "term", "term", "terminator" ] "matches": [
{
"term": "term",
"occurencesOnPage": 3
},
{
"term": "terminal",
"occurencesOnPage": 1
}
]
}, { }, {
"item": "/api/textapi/ahikar/syriac/3r678-126r/latest/item.json", "item": "/api/textapi/ahikar/syriac/3r678-126r/latest/item.json",
"label": "Cod. Arab. 236 Copenhagen", "label": "Cod. Arab. 236 Copenhagen",
"n": "126r", "n": "126r",
"match": [ "terminal" ] "matches": [
{
"term": "terminal",
"occurencesOnPage": 1
}]
} ] } ]
}, },
"took": 678 "took": 678
......
Supports Markdown
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