You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/migration-to-4x/migrating-tika-server-4x.adoc
+50-7Lines changed: 50 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,7 +110,14 @@ The `/stream` and `/string` suffixes never described anything a caller could cho
110
110
111
111
Collapsing them also removes the `/detect/stream` vs `/detectors` near-collision. `/detectors` is unchanged -- it lists the server's configured detectors and does not detect anything.
112
112
113
-
**Migration:** drop the suffix. `PUT /detect/stream` becomes `PUT /detect`; `PUT /language/stream` and `PUT /language/string` both become `PUT /language`. Request bodies, headers, and responses are unchanged.
113
+
**Migration:** drop the suffix. `PUT /detect/stream` becomes `PUT /detect`; `PUT /language/stream` and `PUT /language/string` both become `PUT /language`. Request bodies and headers are unchanged, but behavior is not:
114
+
115
+
* `/detect` now runs in the forked worker pool (detection opens containers over
116
+
caller-supplied bytes), so it can return `429` or `503` with `Retry-After`, and `413`,
117
+
like the parsing endpoints. A failure reading the body is now a `500`; 3.x returned
118
+
`200` with `application/octet-stream` as if detection had succeeded.
119
+
* `/language` caps detection input at the first 100,000 characters and uses the default
120
+
`LanguageDetector` on the classpath; 3.x pinned it to Optimaize.
114
121
115
122
=== Handler-Type Changes on `/tika`
116
123
@@ -158,7 +165,12 @@ The HTTP status codes are also more precise:
158
165
header, not `503` or `200`.
159
166
* An unknown or reserved fetcher/emitter (`FETCHER_NOT_FOUND`, `EMITTER_NOT_FOUND`)
160
167
returns `400`, not `500` — the request is permanently malformed, so retrying will not help.
161
-
* A body over `maxRequestSizeBytes` (`PAYLOAD_LIMIT_EXCEEDED`) returns `413`.
168
+
* Two distinct limits return `413`. A request body over `maxRequestSizeBytes` is
169
+
rejected by a request filter with a plain-text `413` -- both a declared
170
+
`Content-Length` over the limit and a chunked body that turns out to be too large.
171
+
Separately, a parse *result* too large for the pipes IPC channel
172
+
(`pipes.maxIpcPayloadBytes`) returns `413` with the JSON status body
173
+
`{"status":"PAYLOAD_LIMIT_EXCEEDED"}`.
162
174
* `/pipes` and `/async` now signal the outcome through the HTTP status (the same
163
175
`429`/`503`/`400`/`413` mappings, plus `Retry-After`) instead of always returning `200`
164
176
with the failure only in the body.
@@ -183,9 +195,22 @@ the exception when there is one. It previously used a `/pipes`-only shape
183
195
and a stringified `emitted`). A parse that threw is now reported by its status enum, not as
184
196
`"ok"`.
185
197
198
+
`/pipes` also rejects with `400`: a malformed request body (the reason is in the response),
199
+
and any emit strategy other than `EMIT_ALL` -- the `/pipes` response carries only
200
+
status and message, so a passback strategy would silently discard the parsed data. Use
201
+
`/rmeta` if you want the data passed back.
202
+
186
203
**`/async` request body.** `POST /async` now requires an object envelope,
187
204
`{"tuples":[ ... ]}`, instead of a bare JSON array; the envelope leaves room for future
188
-
batch-level fields. A bare array (or any body without a `tuples` array) is rejected with `400`.
205
+
batch-level fields. A bare array (or any body without a `tuples` array) is rejected with `400`,
206
+
as is a tuple naming a fetcher or emitter the server does not have -- validated at POST time,
207
+
before anything is queued. A batch larger than the queue's *total* capacity is also a `400`
208
+
telling the caller to split it: retrying cannot help. `429` with `Retry-After` is reserved
209
+
for transient fullness, where the same batch can succeed later.
210
+
211
+
**`FetchEmitTuple` wire format.** The per-tuple parse-context key is `parse-context`;
212
+
3.x used `parseContext`. An unknown field anywhere in a tuple is rejected with a `400`
213
+
naming the field and listing the known ones, instead of being silently ignored.
189
214
190
215
=== `/meta` Is Now Pipes-Backed
191
216
@@ -209,6 +234,10 @@ should check the new status codes above. Clients that inspected the response bod
209
234
for error text should check `tk:exception:container-exception` (full-object
210
235
endpoints) or the `422` body (`/meta/\{field}`).
211
236
237
+
**The default representation is now JSON, not CSV.** A `/meta` request without an
238
+
`Accept` header returned CSV in 3.x; it now returns JSON. CSV is still available with
239
+
`Accept: text/csv`.
240
+
212
241
Two changes to the returned metadata come with this, neither of which produces an
213
242
error:
214
243
@@ -219,7 +248,8 @@ error:
219
248
content handler, so there is no text for a language detector to work from.
220
249
+
221
250
**Migration:** configure a language-detection metadata filter
222
-
(`charsoup-metadata-filter`, `optimaize`, or `opennlp`) and use `/rmeta` or
251
+
(`charsoup-metadata-filter`, `optimaize-metadata-filter`, or
252
+
`open-nlp-metadata-filter`) and use `/rmeta` or
223
253
`/tika/json`, which capture content. The detected value arrives as
224
254
`tk:detected-language`, with `tk:detected-language-confidence`. Note that these
225
255
filters read `tk:content`, so they are no-ops on `/meta` and on any endpoint
@@ -269,9 +299,12 @@ The following `TikaServerConfig` options have been removed:
options from the pre-4.0 spawn-child server model, which no longer exists (the `-noFork`
304
+
CLI flag is gone too). Delete them from your config; leaving any in place now fails
305
+
startup, because unrecognized config keys are rejected.
306
+
* `port` is now a single integer. The 3.x multi-instance port ranges and lists
307
+
(`-p 9995-9998`, `-p 9995,9997`) are no longer supported; run one server per port.
275
308
276
309
=== Configuration via HTTP Headers Removed
277
310
@@ -377,6 +410,12 @@ The capabilities are two default-`false` flags in the `server` section:
377
410
378
411
`/status` is no longer gated: it exposes only aggregate counters, so it is enabled simply by listing `status` under `endpoints`.
379
412
413
+
The `endpoints` allowlist now also gates SPI-provided resources: a discovered resource
414
+
whose root path matches a named endpoint binds only when that endpoint is enabled (e.g.
415
+
the `application/rdf+xml` XMP resource serves `/meta`, so omitting `meta` removes it too).
416
+
An SPI resource with a custom root path still loads unconditionally -- installing the jar
417
+
is the opt-in.
418
+
380
419
**Migration:** if your config selects `pipes` or `async`, add `"allowPipes": true`; if you rely on per-request config, add `"allowPerRequestConfig": true`:
381
420
382
421
[source,json]
@@ -422,6 +461,10 @@ and want `/pipes`/`/async` to fetch documents from a directory you control:
422
461
}
423
462
----
424
463
464
+
The 3.x `pipes` keys `staleFetcherTimeoutSeconds` and `staleFetcherDelaySeconds` are gone.
465
+
A pipes config still carrying either fails startup: unknown pipes keys are rejected, not
466
+
ignored.
467
+
425
468
[IMPORTANT]
426
469
====
427
470
Set `basePath` to a directory that contains only the documents you intend the
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/migration-to-4x/migrating-to-4x.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ If you have build scripts or container images that drop in just the jar, update
45
45
In 3.x the default content handler produced XHTML/XML. In 4.x the default is **Markdown** everywhere:
46
46
47
47
* `tika-app` outputs Markdown by default (was XHTML). Pass `-x`/`--xml`, `-h`/`--html`, or `-t`/`--text` to choose another format.
48
-
* `tika-server` — the `/tika` and `/rmeta` endpoints return Markdown content by default (was XHTML/XML). Use an explicit handler path (`/tika/xml`, `/rmeta/xml`, ...) to choose another format.
48
+
* `tika-server` -- the `/tika` and `/rmeta` endpoints return Markdown content by default. In 3.x, `/rmeta` returned XML content, and a bare `/tika` PUT routed among plain text, HTML, and XHTML by `Accept` header -- nondeterministically for `*/*`. Use an explicit handler path (`/tika/xml`, `/rmeta/xml`, ...) to choose another format.
49
49
* The async/pipes CLI emits Markdown by default (was plain text). Use `--handler x` (etc.) to choose another format.
50
50
51
51
If you parse the extracted content programmatically and expect XHTML/XML, request it explicitly as shown above (TIKA-4663).
@@ -364,7 +366,7 @@ Server behavior beyond host/port is controlled by a JSON config file passed via
364
366
365
367
|`maxQueuePauseMillis`
366
368
|`60000`
367
-
|How long a POST to `/async` blocks when the queue is full before it is rejected with `429` (`Retry-After`).
369
+
|How long a POST to `/async` blocks when the queue is full before it is rejected with `429` (`Retry-After`). A batch larger than the queue's total capacity is rejected immediately with `400` -- retrying cannot help; split the batch.
368
370
369
371
|`requestLogLevel`
370
372
|_empty (off)_
@@ -448,10 +450,12 @@ mitigation (scope `endpoints` to what you actually use, or set
448
450
449
451
=== Config Endpoint Protection
450
452
451
-
By default, the `/config` family of endpoints that expose server configuration are
452
-
disabled. These endpoints can reveal sensitive information about your server,
453
-
including parser settings and system properties (see
0 commit comments