* feat: metadata autopropagation
* feat: autoprop support for MFA / vault mode
* fix: replace some http clients with reva ones
* chore: required lib update
* fix: adjust unit tests and generate new mocks
* fix: apply autopropagation to all regular graph routes
* chore: updated reva dependency
* fix: return the right decorator for the thumbnails
* fix: remove autopropagation headers in the proxy
Add regression coverage for case-insensitive wildcard queries on photo
keyword fields, protecting PR #12078 (the lowercaseKeyword analyzer fix).
Only the Name field previously had a case-insensitive test; the photo
fields that #12078 fixed had none.
- bleve_test.go: integration spec indexing cameraMake="Canon" and
asserting canon/Canon/*Canon*/*canon* all return 1 hit. The uppercase
wildcard form is what the advanced-search web extension actually sends.
- compiler_test.go: unit case asserting photo.cameraMake:*Canon* compiles
to photo.cameraMake:*canon*, pinning the query-side strings.ToLower
independent of the index.
Signed-off-by: Paul Faure <paul@faure.ca>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Martin <github@diemattels.at>
Add a CLI-only optimize command that compacts the Bleve search index by
merging segments. The command opens the index directly via a new engine
factory (NewEngineFromConfig), without requiring the running gRPC service.
Key changes per review feedback from jvillafanez:
- CLI-only: no gRPC endpoint, no proto changes — admin triggers it
directly when disruption is acceptable
- Engine factory: extracted engine creation from the gRPC handler into
NewEngineFromConfig, reusable by both the service and CLI commands
- Optimize() merged into Engine interface: no separate Optimizer
interface, non-supporting engines can return an error
Signed-off-by: Paul Faure <paul@faure.ca>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Martin <github@diemattels.at>
Replace the per-file Search() call in IndexSpace with a direct Lookup()
using Bleve's DocIDQuery. The old approach parsed a KQL query string,
compiled it, and ran a full-text search for each file — taking 600-950ms
per file on large indexes. The new approach does an O(1) document lookup
by ID and compares mtime/Extracted fields in memory.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add an Optimizer optional interface and Bleve.Optimize() method that
triggers ForceMerge to compact all index segments into one. Called
automatically after IndexSpace completes its walk. Over time, writes
create multiple segments that degrade query performance — compaction
consolidates them for faster searches.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two changes to fix permanently stuck index entries:
1. (Option D) Validate Tika responses: if MetaRecursive() returns an
empty metadata list, treat it as an error. This prevents Tika HTTP 200
responses with no actual content from being accepted as successful
extractions.
2. (Option B) Add Extracted field to Resource: a boolean that is set to
true only when UpsertItem completes successfully. The IndexSpace skip
check now requires Extracted:true in addition to matching id+mtime.
Documents that were written with incomplete extraction data will be
automatically re-processed on the next reindex.
Background: When Tika returns HTTP 200 but its child processes (OCR,
ImageMagick) fail due to resource limits (EAGAIN, OOM), the Go Tika
client receives metadata headers but no X-TIKA:content. The doc gets
written to Bleve with the correct mtime, and subsequent reindexes skip
it forever because the id+mtime check passes.
Fixes: #12093
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- UpdateTags now updates only the tags field instead of all basic
metadata (name, size, mimetype, path, parentID), per reviewer
feedback that those are structural fields not metadata.
- Removed refreshMetadata helper that was over-reaching.
- Introduced ErrResourceNotFound sentinel in engine package so
UpdateTags can distinguish "not indexed" (fallback to UpsertItem)
from connectivity or other errors (log and stop).
- Added GoDoc example for the Update mutateFn callback.
- Added test for non-retriable error path.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address reviewer feedback:
- Remove checksum field from index (bloats index, not searched)
- Remove skipUnchangedContent guard (not needed with UpdateTags path)
- Replace engine.Retrieve() with engine.Update(id, mutateFn) that does
get+mutate+set internally, avoiding public exposure of raw retrieval
- Simplify UpdateTags to use engine.Update() with mutation function
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tag events (TagsAdded/TagsRemoved) previously called UpsertItem which
triggered a full Tika content extraction for metadata-only changes.
Additionally, UpsertItem's SetArbitraryMetadata writeback bumped the
mtime, causing IndexSpace to call UpsertItem again — running Tika
twice per file. On servers with large libraries this caused a
denial-of-service from runaway convert/tesseract processes.
Fix by:
- Adding UpdateTags() to the Searcher interface for tag-only updates
that preserve existing Tika-extracted content
- Adding Retrieve() to the Engine interface to load indexed resources
- Comparing the content checksum (already computed by decomposedfs on
upload) in UpsertItem to skip Tika and the metadata writeback when
the blob has not been written to
- Extracting refreshMetadata() helper shared by both code paths
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Addresses SonarCloud goconst finding — the string "lowercaseKeyword"
appeared 4 times without a named constant.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bleve's query string parser lowercases search terms, but the keyword
analyzer stores values as-is. This made photo field searches like
cameraMake:google fail to match "Google". Switch from keyword to
lowercaseKeyword analyzer so both sides are lowercased.
Note: existing Bleve indexes need to be rebuilt after this change.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add location field mappings with Store=true in Bleve index
- Rename properties to oc:photo-location-* for consistency
- Add altitude support alongside latitude/longitude
- Requires index rebuild to take effect
This change enables photo gallery applications to access EXIF metadata
through the search API.
Changes:
- Add KQL query support for photo fields:
- photo.takenDateTime (datetime range queries)
- photo.cameraMake, photo.cameraModel (keyword queries)
- photo.fNumber, photo.focalLength, photo.iso (numeric queries)
- Configure Bleve index to store photo fields (Store=true)
- Map photo metadata from Bleve hits to Entity.Photo protobuf
- Add oc:photo-* properties to WebDAV search responses
- Add unit tests for photo field queries
The photo metadata is extracted by Tika during indexing and stored
in the Bleve search index. This enables queries like:
photo.takenDateTime:[2023-01-01 TO 2023-12-31]
photo.cameraMake:Canon
Signed-off-by: Paul Faure <paul@faure.ca>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The closeFn implicitly checks the value as the implementation decides
what to do (either do nothing or close the index). Calling the closeFn
is safe and we don't need conditions.
* enhancement: allow ocis to provide custom web applications
* enhancement: add an option to disable web apps
* test: add default logger tests
* test: add app loading tests
* test: add asset server tests
* enhancement: make use of dedicated app conf file and app asset paths
* enhancement: adjust asset locations and deprecate WEB_ASSET_PATH
* enhancement: get rid of default logger and use the service level logger instead
* Apply suggestions from code review
Co-authored-by: Benedikt Kulmann <benedikt@kulmann.biz>
Co-authored-by: kobergj <juliankoberg@googlemail.com>
* enhancement: use basename as app id
* Apply suggestions from code review
Co-authored-by: Martin <github@diemattels.at>
* enhancement: use afero as fs abstraction
* enhancement: simplify logo upload
* enhancement: make use of introductionVersion field annotations
---------
Co-authored-by: Benedikt Kulmann <benedikt@kulmann.biz>
Co-authored-by: kobergj <juliankoberg@googlemail.com>
Co-authored-by: Martin <github@diemattels.at>
* bump mockery, add test stub for oidc_auth.go
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
* use .mockery.yaml for all mocks
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
* drop legacy go:generate mockery
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
* align mock placement
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
---------
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
* Add audio facet to search protobuf message
* Add audio metadata to search index
* Return audio facet from search if available
* Store audio metadata in arbitrary metadata
* Add audio facet to driveItems listings
* Make tests coding style more consistent
* Fix tests
* Add changelog
* Make valueToString code more defensive
* Log status code as well
* enhancement: use kql as default search query language
* enhancement: add support for unicode search queries
* fix: escape bleve field query whitespace
* fix: search related acceptance tests
* enhancement: remove legacy search query language
* enhancement: add support for kql dateTime restriction node types
* chore: bump web to v8.0.0-alpha.2
* fix: failing search api test
* enhancement: search bleve query compiler use DateRangeQuery as DateTimeNode counterpart
* enhancement: support for colon operators in dateTime kql queries
* feat(search): introduce search query package
With the increasing complexity of how we organize our resources, the search must also be able to find them using entity properties.
The query package provides the necessary functionality to do this.
This makes it possible to search for resources via KQL, the microsoft spec is largely covered and can be used for this.
In the current state, the legacy query language is still used, in a future update this will be deprecated and KQL will become the standard