Skip to content

Commit

Permalink
Format the JSON response docs example more nicely.
Browse files Browse the repository at this point in the history
  • Loading branch information
khituras committed Dec 29, 2022
1 parent 1ed7738 commit bf88c3b
Showing 1 changed file with 60 additions and 2 deletions.
62 changes: 60 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,72 @@
This search engine was developed in the context of the [SMITH](https://www.smith.care/de/) project. It aims to specifically offer search capabilities for medical text in German. Its main feature is the seamless integration of semantic concepts, called named entities, into the search index. This allows to search for canonical IDs of diseases, medications or possibly other entity types. Thus, instead of providing the search engine with synonyms and writing variants of the same concept in order to retrieve as much relevant documents as possible, these steps are handled in the preprocessing step and woven into the index. The engine offers faceting and highlighting capabilities that work with normal text queries as well as entity IDs. Entity IDs and normal words can be used in arbitrary combinations since the entity IDs are just words from the perspective of the search index.

Consider this example request:
```json
```
curl -XPOST http://localhost:8080/search -H 'Content-Type: application/json' -d '{"query":"R05","from":0,"size":1,"doHighlighting":true}'
```

Given that matching documents exist in the search index, the response looks like this:

```json
{"hits":[{"docId":"1234","text":"Eine 76-jährige Patientin meldet sich in der Sprechstunde an, weil sie seit einiger Zeit an Husten leidet. [...]","highlights":["Eine 76-jährige Patientin meldet sich in der Sprechstunde an, weil sie seit einiger Zeit an <em>Husten</em> leidet","einem Atemwegsinfekt mit Schnupfen, Gliederschmerzen, Abgeschlagenheit, leichtem Fieber und leichtem <em>Husten</em>"]}],"numHits":61,"numHitsRelation":"Eq","entityIdCounts":[{"entityId":"R05","count":61},{"entityId":"R06.0","count":14},{"entityId":"Z01.7","count":7},{"entityId":"R07.0","count":5},{"entityId":"E66.-","count":4},{"entityId":"I50.-","count":4},{"entityId":"R29.1","count":4},{"entityId":"B05.-","count":3},{"entityId":"B26.-","count":3},{"entityId":"G93.6","count":3}]}
{
"hits":
[
{
"docId": "1234",
"highlights":
[
"Eine 76-jährige Patientin meldet sich in der Sprechstunde an, weil sie seit einiger Zeit an <em>Husten</em> leidet",
"einem Atemwegsinfekt mit Schnupfen, Gliederschmerzen, Abgeschlagenheit, leichtem Fieber und leichtem <em>Husten</em>"
],
"text": "Eine 76-jährige Patientin meldet sich in der Sprechstunde an, weil sie seit einiger Zeit an Husten leidet. [...]"
}
],
"numHits": 61,
"numHitsRelation": "Eq",
"entityIdCounts":
[
{
"count": 61,
"entityId": "R05"
},
{
"count": 14,
"entityId": "R06.0"
},
{
"count": 7,
"entityId": "Z01.7"
},
{
"count": 5,
"entityId": "R07.0"
},
{
"count": 4,
"entityId": "E66.-"
},
{
"count": 4,
"entityId": "I50.-"
},
{
"count": 4,
"entityId": "R29.1"
},
{
"count": 3,
"entityId": "B05.-"
},
{
"count": 3,
"entityId": "B26.-"
},
{
"count": 3,
"entityId": "G93.6"
}
]
}
```

Note how `Husten` is highlighted upon a search for `R05`. Also note the `entityId` counts where `R05` has the highest count, because it was the search query.
Expand Down

0 comments on commit bf88c3b

Please sign in to comment.