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

feat: add first draft for search

parent 3be49886
---
title: Search API Specification
version: 0.0.1
---
# Search
The used query syntax and objects are prepared alike those for Elasticsearch, but
not completely similar.
## Endpoint
`https://ahikar.sub.uni-goettingen.de/api/search`
## Search Request
`POST` the following object to the endpoint to execute a search.
```json
{
"query": {
"simple_query_string": {
"query": "",
}
},
"from": 0,
"size": 10,
"kwicsize": 20
}
```
## Search Response
```json
{
"took" : 1,
"hits" : {
"total" : {
"value" : 2
}
"hits" : [ {
"kwic" : {
"following" : " lucene index",
"prev" : "",
"hit" : "element"
},
"score" : 3.5844567,
"hit" : "<ab xmlns=\"http://www.tei-c.org/ns/1.0\">element lucene index</ab>",
"title" : "element test lucene index"
}, {
"kwic" : {
"following" : ".",
"prev" : "Das ist ein ab ",
"hit" : "element"
},
"score" : 3.1363995,
"hit" : "<ab xmlns=\"http://www.tei-c.org/ns/1.0\">Das ist ein ab element.</ab>",
"title" : "element test lucene index"
} ]
},
}
```
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