-
Notifications
You must be signed in to change notification settings - Fork 171
search-summary and search produce different results #1350
Description
Hi there
I recently switched DMS to docspell, really like it so far and plan to stick with it.
Because it will handle all of my paperwork, I want to have a backup option in addition to the raw database (I agree it is an easy way that works well, but when backing up important data I prefer two formats).
To get the data out of the database without having to write my own exporter, I wanted to take advantage of dsc .
But unfortunately it does not find/export all of my data. search-summary correctly displays the database contents:
$ dsc search-summary '!tag=ToDo'
All
┌───────┐
│ items │
├───────┤
│ 469 │
└───────┘
[...]search (and consequently, export and download) does not, however:
$ dsc search --all --limit 1000 '!tag=ToDo' | wc -l
204Disregarding the header and footer lines of dsc search, this does ignore more than half of the documents.
When exporting/downloading using the same approach, only the above listed 200 documents actually appear.
The same behaviour can be reproduced with the raw API endpoints:
$ curl -X 'POST' 'http://127.0.0.1:7880/api/v1/sec/item/searchStats' -d '{ "query": "!tag=ToDo" }' | jq .count
469$ curl -X 'POST' 'http://127.0.0.1:7880/api/v1/sec/item/search' -d '{ "limit": 1000, "query": "!tag=ToDo" }' | jq | grep '"source"' | wc -l
200For completeness: I am running the latest versions of the images in the official docker-compose stack.