annosearch 0.1.9 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -2
- package/dist/index-config.yaml +8 -12
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -1,7 +1,45 @@
|
|
|
1
1
|
|
|
2
2
|
# Annotation Search
|
|
3
3
|
|
|
4
|
-
AnnoSearch uses [Quickwit](https://quickwit.io) as its backend database to efficiently index and query [W3C Web Annotation](https://www.w3.org/TR/annotation-model/) data. AnnoSearch can
|
|
4
|
+
AnnoSearch uses [Quickwit](https://quickwit.io) as its backend database to efficiently index and query [W3C Web Annotation](https://www.w3.org/TR/annotation-model/) data, leveraging a declarative approach to simplify ingestion and management. AnnoSearch can ingest data directly from [IIIF](https://iiif.io/) resources and web annotation servers such as [Miiify](https://github.com/nationalarchives/miiify) and make it available to IIIF viewers through the [IIIF Content Search 2.0 API](https://iiif.io/api/search/2.0/).
|
|
5
|
+
|
|
6
|
+
## Tutorial
|
|
7
|
+
|
|
8
|
+
We first need to create an index.
|
|
9
|
+
```
|
|
10
|
+
❯ annosearch init --index cookbook
|
|
11
|
+
Index created successfully
|
|
12
|
+
```
|
|
13
|
+
We can now load the index with the annotations referenced in a IIIF manifest.
|
|
14
|
+
```
|
|
15
|
+
❯ annosearch load --index cookbook --type Manifest --uri https://iiif.io/api/cookbook/recipe/0266-full-canvas-annotation/manifest.json
|
|
16
|
+
Loading Manifest from https://iiif.io/api/cookbook/recipe/0266-full-canvas-annotation/manifest.json into index cookbook
|
|
17
|
+
|+|
|
|
18
|
+
```
|
|
19
|
+
After Quickwit finishes ingesting and indexing the data we can perform a search.
|
|
20
|
+
```
|
|
21
|
+
❯ annosearch search --index cookbook --query brunnen
|
|
22
|
+
{
|
|
23
|
+
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
24
|
+
"id": "http://localhost:3000/cookbook/search?q=brunnen&page=0",
|
|
25
|
+
"type": "AnnotationPage",
|
|
26
|
+
"startIndex": 0,
|
|
27
|
+
"items": [
|
|
28
|
+
{
|
|
29
|
+
"body": {
|
|
30
|
+
"format": "text/plain",
|
|
31
|
+
"language": "de",
|
|
32
|
+
"type": "TextualBody",
|
|
33
|
+
"value": "Göttinger Marktplatz mit Gänseliesel Brunnen"
|
|
34
|
+
},
|
|
35
|
+
"id": "https://iiif.io/api/cookbook/recipe/0266-full-canvas-annotation/canvas-1/annopage-2/anno-1",
|
|
36
|
+
"motivation": "commenting",
|
|
37
|
+
"target": "https://iiif.io/api/cookbook/recipe/0266-full-canvas-annotation/canvas-1",
|
|
38
|
+
"type": "Annotation"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
```
|
|
5
43
|
|
|
6
44
|
## Usage
|
|
7
45
|
|
|
@@ -48,7 +86,7 @@ Perform a search on a specified index.
|
|
|
48
86
|
annosearch search --index <index-id> --query <search-query> [--page <page-number>] [--motivation <motivation>] [--date <date-ranges>] [--user <users>]
|
|
49
87
|
```
|
|
50
88
|
|
|
51
|
-
- `query`:
|
|
89
|
+
- `query`: A space separated list of search query terms.
|
|
52
90
|
- `page`: Optional page number (defaults to 0).
|
|
53
91
|
- `motivation`: Optional space separated list of motivation terms.
|
|
54
92
|
- `date`: Optional space separated list of date ranges.
|
package/dist/index-config.yaml
CHANGED
|
@@ -2,18 +2,14 @@ version: "0.8"
|
|
|
2
2
|
|
|
3
3
|
doc_mapping:
|
|
4
4
|
mode: dynamic
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- name: created
|
|
14
|
-
type: datetime
|
|
15
|
-
fast: true
|
|
16
|
-
|
|
5
|
+
dynamic_mapping:
|
|
6
|
+
indexed: true
|
|
7
|
+
stored: true
|
|
8
|
+
tokenizer: default
|
|
9
|
+
record: position
|
|
10
|
+
expand_dots: true
|
|
11
|
+
fast: true
|
|
12
|
+
|
|
17
13
|
|
|
18
14
|
|
|
19
15
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "annosearch",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*"
|
|
7
7
|
],
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "tsc &&
|
|
9
|
+
"build": "tsc && node copy-files.mjs",
|
|
10
10
|
"start": "ts-node src/index.ts",
|
|
11
11
|
"test": "jest"
|
|
12
12
|
},
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"@types/node": "^22.10.2",
|
|
28
28
|
"@types/pino": "^7.0.4",
|
|
29
29
|
"@types/yargs": "^17.0.33",
|
|
30
|
-
"cp-cli": "^2.0.0",
|
|
31
30
|
"typescript": "^5.7.2"
|
|
32
31
|
},
|
|
33
32
|
"dependencies": {
|