Changelog¶
All notable changes to LuceneServerNET are documented in this file.
The format is based on Keep a Changelog.
[3.0.0] - unreleased¶
Migration from 2.x¶
| Area | What changes | What to do |
|---|---|---|
| Index ids / metadata names | Only a-z, 0-9, _, -, max. 64 chars |
Rename index folders that do not match before upgrading |
| HTTP methods | createindex, refresh, releaseall → POST; removeindex, remove → DELETE |
Update REST clients; old GET routes work while LuceneServer:AllowLegacyGetMutations is true (default) – set it to false once all clients are migrated |
NuGet LuceneServerNET.Client 3.0.0 |
Uses POST/DELETE | Requires a v3 server – upgrade the server first |
| Authentication | Roles read/write/admin, hashed secrets (SecretHash) |
Not breaking: clients without Roles get admin, plain Secret still works. Recommended: assign roles and switch to SecretHash (--hash-secret) |
| API v2 errors | HTTP 4xx/5xx instead of 200 | Only relevant for new v2 clients; v1 is unchanged |
| Swagger | Replaced by /openapi/{v}.json and /scalar |
Old /swagger URLs redirect |
| Phonetic search | Fixed Cologne phonetics and Soundex codes (see Fixed) | Recommended: re-index indices with primaryFieldsPhonetics, otherwise affected words do not match in searchphonetic until re-indexed. Normal search is not affected |
| .NET client dispose | Console output replaced by optional Logger; IAsyncDisposable |
Not breaking. Optionally use await using; set Logger to keep the refresh log lines |
datetime fields |
Values without time zone are taken as UTC (before: server local time); results contain Z |
Only relevant if the server does not run in UTC and clients send dates without time zone: send Z/an offset or re-index. Docker (UTC) is not affected |
| Versions | Server, Engine, Core and Client share one version (git tag v*, MinVer) |
– |
Added¶
- Docker image and Aspire AppHost no longer set
LuceneServer:ArchivePath(the archive is optional, set it explicitly if needed). PUT /api/v2/indices/{index}?archive=falsecreates an index without archive (also withArchivePath); clientCreateIndexAsync(index, archive: false). Import jobs create their index generations without archive (about 26 times faster on Windows).-
DELETE /api/v2/indices/{index}/meta/{name}removes a custom metadata entry (also from the archive); clientRemoveMetadataAsync. -
REST API v2 (
/api/v2/indices/{id}/...), resource oriented, in parallel to v1 (/Lucene/...). v1 stays fully supported (not breaking) but is marked as deprecated in Swagger. Separate OpenAPI documents forv1andv2. - Paging and total hit count for search (v1 and v2, additive):
new optional parameters
from(offset,from + size≤ 10000) andsearchAfter(cursor); responses containtotalHits,from,sizeandnextSearchAfter. LuceneServerNET.Client:SearchPageAsync/SearchPhoneticPageAsync(existing methods unchanged).- Index aliases (additive): an alias points to one index and can be used instead of the index id in all
v1 and v2 endpoints (search, documents, mapping, metadata, stats, export), except creating and removing indices.
Switching is atomic, e.g. rebuild into
orte_20261107and switch the aliasortewithout downtime.GET /api/v2/aliases,PUT /api/v2/aliases/{alias}({ "index": "..." }, rolewrite),DELETE /api/v2/aliases/{alias}. Stored in{RootPath}/aliases.json(copy in{ArchivePath}). An index used by an alias can not be removed (409), an alias can not have the name of an index. Client:GetAliasesAsync,SetAliasAsync,RemoveAliasAsync. - Admin UI (
LuceneServerNET.Admin, Blazor Server + MudBlazor), a separate web app that administrates several server instances through the v2 API: dashboard (health, version, uptime, roles), index list with document count and size, search playground (autocomplete, search with paging/sort/spatial filter, phonetic search, group by, curl command), create index with mapping editor, import from CSV/JSON (mapping proposed from a sample, configurable batch size, error report, cancel), metadata editor and maintenance (refresh, delete documents by query, clear, delete index). Login: local users (hashed passwords,--hash-password) or OpenID Connect. Instances from the configuration and added in the UI (secrets encrypted with DataProtection, SQLite/Dapper). Docker image:Dockerfile.admin; started by the Aspire AppHost. Import from a database (SQL Server, PostgreSQL, SQLite): stored connections (encrypted), a SELECT query with preview, then the same mapping proposal and batch import as for files. Geo data import: geometry columns (WKB/EWKB, WKT/EWKT, GeoJSON; PostGISST_AsEWKB, SQL ServerSTAsBinary()), GeoJSON files (FeatureCollection) and coordinate columns (lat/lon, x/y), converted to WGS84 with Proj4Net (source EPSG from the SRID of the value or chosen in the UI). Lines/polygons are indexed as point on surface plus a bounding box field (<field>_bbox), the original geometry can be stored as GeoJSON (<field>_geojson). PostGISgeometry/geographycolumns are read directly (also withSELECT *), SQL Server geometry columns give a hint to useSTAsBinary(). Encoded characters of the primary fields (PrimaryFieldsEncodeCharacters, e.g../) can be set when creating an index, importing and in import jobs. Template fields in the import mapping: a field built from columns ({PLZ} {ORT} {STR} {HNR}, empty brackets removed), with text replacements. Database connections: show the stored connection string on request with masked password (audit log), edit it without re-entering the password; connection test in the list. Copy an index (mapping, metadata, documents) to another name or another instance. Alias management. Scheduled import jobs (cron, time zone) from a database query: rebuild a new index generation and switch an alias (no downtime, keeps N older generations, a failed run leaves the alias unchanged), clear and refill or append; run history, run now, cancel; dry run (read and convert only) and time per phase (read, convert, send) in the run history; live progress of running jobs (rows, rate, estimate from the last run); manual jobs without schedule; missed runs are caught up once at startup (per job); several sources per job (one index, metadata entry per source with a stable meta id, template variables {@metaid}/{@category}); "webgis" template (id, suggested_text, subtext, category, thumbnail_url, geo, bbox) replacing gView FillLuceneServer; import of gView FillLuceneServer configurations as job; external trigger per job (POST /api/jobs/{id}/runwith a job token, e.g. from Jenkins; a trigger during a run queues one more run; status viaGET /api/jobs/{id}/runs/{runId}, optional note); optional webhook after a run (always or on failure, JSON statistics with a Slack/Mattermost compatibletext, encrypted header, 3 attempts). Admin UI as Windows service:lucene-admin-service.bat install|uninstall [name] [port](virtual service account, restart on failure, data and configuration_config/admin.jsonnext to the version folders, event log); the win64 release ZIP contains the admin UI ({version}/admin) and the scripts. IIS notes for import jobs in the docs. Index backup as ZIP download (manifest, mapping, metadata, documents as NDJSON) and restore from such a ZIP. Audit log of all changing actions (index, mapping/metadata, import, instances, connections, login), with filter page and retention (Admin:Audit:RetentionDays, default 180). - API v2 endpoints for administration:
GET /api/v2/indices(index names),GET /api/v2/indices/{id}/stats(documents, size on disk, last modification),GET /api/v2/admin/info(version, uptime, platform; roleadmin) andGET /api/v2/admin/whoami(roles of the calling client) andGET /api/v2/indices/{id}/documents/_export(all documents as NDJSON, stored fields; roleread). LuceneServerNET.Client: newLuceneServerV2Clientfor the v2 API (not bound to one index;LuceneServerClientis unchanged), incl.ExportDocumentsAsync(streamed).
Changed¶
- Engine: errors of the background refresh/commit and of releasing indices are logged via
ILogger(before:Console.Error), so they show up in structured logs / OpenTelemetry. -
New config
LuceneServer:BackgroundCommitSeconds(default20): interval of the background refresh + commit of all open indices. -
LuceneServerNET.Client: refresh on dispose made configurable and safer (not breaking): - New property
RefreshChangedIndicesOnDispose(defaulttrue= previous behavior). - Implements
IAsyncDisposable; useawait using.Dispose()still works and no longer blocks on async code in the caller's synchronization context; it is idempotent and never throws. - No more
Console.WriteLineoutput; optionalLoggerproperty (ILogger) instead.cmd/ImportDbTablepasses a console logger. - Without a passed
HttpClient, all instances share one internalHttpClientinstead of creating (and never disposing) one per instance. -
New dependencies:
Microsoft.Bcl.AsyncInterfaces,Microsoft.Extensions.Logging.Abstractions. -
Error handling: errors are logged only via
ILogger(no moreConsole.WriteLine),milliSecondsis measured withStopwatch. - New config
LuceneServer:MaxRequestBodySizeBytes(default 30 MB, Kestrel and IIS) limits request bodies, e.g. for indexing. - New config
LuceneServer:UseHttpsRedirection(defaultfalse) enables HTTP → HTTPS redirection. -
A warning is logged if the OpenAPI/Scalar UI is enabled outside
Development(useSwagger: true). -
OpenAPI via
Microsoft.AspNetCore.OpenApiand Scalar instead of Swashbuckle. ASP.NET Core no longer ships Swagger by default; the documents are now generated by the framework (OpenAPI 3.1). Swashbuckle is removed. - Documents:
/openapi/v1.json,/openapi/v2.json; UI:/scalar(Basic auth supported in "Try it"). - Old URLs
/swaggerand/swagger/{v}/swagger.jsonredirect to the new ones. - Config key
useSwaggeris unchanged.
Changed (breaking)¶
-
API v2 returns errors with HTTP status codes instead of HTTP 200:
400(invalid query/ParseException, invalid filter, invalid parameters such asfrom + size> 10000),404(index not found),409(index already exists / is unloading),500(other errors). The body is still{"success": false, "message": "..."}. v1 (/Lucene/...) is unchanged and keeps HTTP 200. For client errors (4xx) the message is now returned also in production (before: only the exception type). -
State-changing endpoints no longer use HTTP GET. GET requests must be safe; prefetchers, link previews, crawlers and CSRF (
<img src=…>) could create or delete indices. POST /Lucene/createindex/{id},DELETE /Lucene/removeindex/{id},DELETE /Lucene/remove/{id}?term=…&termField=…,POST /Lucene/refresh/{id},POST /Lucene/releaseall.- Transition: the old GET routes still work while
LuceneServer:AllowLegacyGetMutationsistrue(default). They are marked[Obsolete], returnDeprecation: trueandWarning: 299headers and log a warning. Withfalsethey return405 Method Not Allowed. LuceneServerNET.Client3.0.0 uses the new methods and therefore requires a v3 server.
Security¶
- Path traversal protection for index and metadata names. Index ids from the route
(e.g.
removeindex/..) and custom metadata names (e.g.getmeta/{id}?name=../../x) were passed unchecked intoPath.Combineand could read, create or delete files and directories outside ofRootPath/ArchivePath. - Index ids and metadata names must now match
^[a-z0-9_-]{1,64}$(ids are lower-cased first). - Validation happens centrally in the controller and again in the engine
(
LuceneService,LuceneSharedResourcesService,ArchiveService). - All file system paths are built via the new
PathGuard.Combine, which ensures the resolved path stays below the configured root directory. releaseallno longer uses the"*"placeholder id; every route id is validated without exception.
Breaking Changes¶
- Index ids and metadata names containing characters other than
a-z,0-9,_,-(e.g.., spaces, umlauts) or longer than 64 characters are now rejected. - REST clients: such requests return an error result (
success: false). - NuGet client
LuceneServerNET.Client: no API change; affected calls receive the error result. - Existing indices on disk: files are not touched, but indices whose folder name does not match the rule are no longer reachable via the API until renamed.
Fixed¶
- Numbers independent of the server culture: stored
double/single/int32values were returned formatted with the server culture ("47,0707"on a german server) and numeric strings in documents were parsed with it ("47.0707"was indexed as470707). Values are now parsed and returned culture invariant ("47.0707"; still as string, like before). Stored-only numeric fields (index: false) also accept JSON values now. Indices with numeric strings indexed on a non-english server should be re-indexed. datetimeindependent of the server time zone: dates without time zone were interpreted as server local time and shifted to UTC (1128-01-01became1127-12-31T23:00:00on a server in CET) and were returned withoutZ. Now: values without time zone are UTC, values withZ/offset are converted, results are UTC withZ. Stored-only date fields are written as ISO 8601 (older culture formatted values are still read).-
group: group values are decoded withBytesRef.Utf8ToString()(respects offset/length) instead of decoding the whole underlying byte buffer. No visible effect with the current Lucene.NET version (it returns exact copies), but no longer relies on that implementation detail. -
Cologne phonetics: a
cat the end of a word was ignored; it is now encoded as8(Novac→638, before63). - Soundex: the code of the first letter is now used to suppress an identical following code
(
Pfister→P236, beforeP123), and vowels now separate identical codes whileh/wdo not (Tymczak→T522, beforeT520). -
⚠️ Both fixes change the stored phonetic codes. Existing indices keep the old codes until they are re-indexed: e.g. a misspelled search for
Nowacno longer findsNovacviasearchphoneticuntil the index is rebuilt. Only the phonetic fields are affected, not the normal search. -
GeoPoint(latitude, longitude)constructor setLatitudetwice;Longidutestayed0. -
GeoType.Parsenever parsed coordinate strings (invertedIsNullOrEmptycheck). Strings are now read as"lon lat"or"lon,lat"(same order asGeoPoint.ToString()); invalid strings are ignored instead of throwing. -
The reserved metadata name
mappingis now actually blocked (the old check compared against"mapping "with a trailing space).