Skip to content

docs(config): explain how the response-field keys work together - #3490

Merged
marevol merged 1 commit into
mainfrom
docs/response-fields-config-comments
Sep 24, 2026
Merged

marevol merged 1 commit into
mainfrom
docs/response-fields-config-comments

Conversation

@marevol

@marevol marevol commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Adding a custom field to the search API response takes two settings, but the comments in fess_config.properties describe each key on its own:

  • query.additional.response.fields / query.additional.scroll.response.fields decide which fields are fetched from the index (QueryFieldConfig#getResponseFields / #getScrollResponseFields).
  • query.additional.api.response.fields only adds names to the allow-list that the v2 search API (SearchHandler) and scroll API (ScrollSearchHandler) filter each document through (QueryFieldConfig#isApiResponseField). It does not fetch anything.

So setting only query.additional.api.response.fields=author returns no author, and setting only query.additional.scroll.response.fields=content returns no content from /api/v2/documents/all. The configuration reference page in fess-docs is generated from these comments, so the relationship was missing there as well.

Changes

  • Rewrite the comments of the three keys in fess_config.properties to say which key fetches a field and which one lets it through.
  • Update the matching generated javadoc in FessConfig by hand.

No behaviour change.

The fess-docs properties.rst page will be regenerated from this file in codelibs/fess-docs#553.

query.additional.api.response.fields only adds names to the allow-list
the v2 search and scroll APIs filter each document through; it does not
make the search engine return the field. A field therefore reaches the
search API only when it is also in query.additional.response.fields,
and the scroll API only when it is also in
query.additional.scroll.response.fields. None of the three comments said
so, and the published properties page is generated from them.

Say which keys fetch a field and which one lets it through, in
fess_config.properties and in the matching FessConfig javadoc. No
behaviour change.
@marevol marevol added this to the 15.9.0 milestone Sep 24, 2026
@marevol marevol added the task label Sep 24, 2026
@marevol marevol self-assigned this Sep 24, 2026
marevol added a commit to codelibs/fess-docs that referenced this pull request Sep 24, 2026
…combine

- config/properties: regenerate the descriptions of
  query.additional.response.fields, query.additional.api.response.fields and
  query.additional.scroll.response.fields from the rewritten comments in
  fess_config.properties (codelibs/fess#3490). The catalogues gain the new
  msgids and drop the old ones; like every other entry they are untranslated.
- api/admin/api-admin-backup: fess.json and doc.json are not scrolled like a
  .bulk id. The download returns the mapping definition file itself
  (fess_indices/fess.json, fess_indices/fess/doc.json) as
  application/octet-stream. Add a row for them, replace the wrong note with
  one saying the API only downloads and restoring is done from the admin
  Backup page, and list fess.json among the ids that need a trailing slash.
- config/search-scroll: /api/v2/documents/all filters every document through
  the API response allow-list, which does not contain content. Adding
  content to query.additional.scroll.response.fields only fetches it; it
  also has to be added to query.additional.api.response.fields.
@marevol
marevol merged commit 0b0440d into main Sep 24, 2026
2 checks passed
marevol added a commit to codelibs/fess-docs that referenced this pull request Sep 24, 2026
…duct (#553)

* docs(15.9): correct eight places where the docs disagree with the product

A release test found these pages describing behaviour that Fess does
not have (the same text is in 15.8):

- Backup API: a path whose last segment contains a dot and has no
  trailing slash is treated as a static file request and never reaches
  the action, so /api/admin/backup/file/fess_config.bulk returns 404.
  Say to end such ids with "/" and fix both curl examples.
- Sort search: an unsupported field or order in sort: inside the query
  does not raise an error. The query is escaped and searched again, so
  it is not sorted and usually finds nothing. Only the sort request
  parameter returns 400.
- Response fields: query.additional.api.response.fields only extends
  the allow-list of the search API; the field also has to be fetched
  through query.additional.response.fields. Explain both and show an
  example.
- record_count_relation is EQUAL_TO or GREATER_THAN_OR_EQUAL_TO (the
  TotalHits relation name), not eq/gte, in the search API and the admin
  search list API.
- The search log file is searchlog.log, not search.log.
- Log rotation: the bundled log4j2.xml also deletes compressed files by
  age (fess.log and fess-llm.log 90 days, searchlog.log 90 days,
  audit.log 360 days). Document the periods and the properties that set
  them, and that the 10-file limit applies per date. The French page
  also said 10 MB instead of 100 MB.
- Stopwords guide: it was copied from the mapping guide and described
  source/target fields. The screen has a single word field. Rewrite the
  overview, the field description and the download/upload format.
- Stopwords guide: add a note that each stopwords file is used only by
  its language's analyzer. A word in en/stopwords.txt is removed from
  content/title but can still match through content_ja of documents
  detected as Japanese.

All seven languages, 15.9 tree only.

* docs(15.9): explain how the fetch and allow-list response-field keys combine

- config/properties: regenerate the descriptions of
  query.additional.response.fields, query.additional.api.response.fields and
  query.additional.scroll.response.fields from the rewritten comments in
  fess_config.properties (codelibs/fess#3490). The catalogues gain the new
  msgids and drop the old ones; like every other entry they are untranslated.
- api/admin/api-admin-backup: fess.json and doc.json are not scrolled like a
  .bulk id. The download returns the mapping definition file itself
  (fess_indices/fess.json, fess_indices/fess/doc.json) as
  application/octet-stream. Add a row for them, replace the wrong note with
  one saying the API only downloads and restoring is done from the admin
  Backup page, and list fess.json among the ids that need a trailing slash.
- config/search-scroll: /api/v2/documents/all filters every document through
  the API response allow-list, which does not contain content. Adding
  content to query.additional.scroll.response.fields only fetches it; it
  also has to be added to query.additional.api.response.fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant