Skip to content

fix(zim): correct config_indexing docstring to full-text only#297

Draft
Bojun-Vvibe wants to merge 1 commit intoopenzim:mainfrom
Bojun-Vvibe:fix/openzim-python-scraperlib-294
Draft

fix(zim): correct config_indexing docstring to full-text only#297
Bojun-Vvibe wants to merge 1 commit intoopenzim:mainfrom
Bojun-Vvibe:fix/openzim-python-scraperlib-294

Conversation

@Bojun-Vvibe
Copy link
Copy Markdown

Closes #294

Repo

openzim/python-scraperlib

Issue

#294

Root cause

The docstring of Creator.config_indexing in src/zimscraperlib/zim/creator.py stated it toggled "full-text and title indexing of entries". In reality, libzim's config_indexing only toggles the full-text index; the title index is always built. The python-scraperlib documentation was therefore misleading.

Fix

Updated the docstring of Creator.config_indexing to state it toggles full-text indexing only and added an explicit note that title indexing is always performed by libzim and cannot be disabled via this method.

Regression test

tests/zim/test_zim_creator.py::test_config_indexing_docstring_only_mentions_full_text asserts the docstring contains "full-text" and does NOT contain the misleading phrase "full-text and title indexing".

Risk

trivial

Verification

Local pytest plugin environment was broken (missing textual module unrelated to this repo). Verified the fix via AST inspection of the updated source: the docstring contains "full-text" and no longer contains "full-text and title indexing" — matching the regression test's assertions. Result: PASS.

The docstring of Creator.config_indexing claimed it toggled both
full-text and title indexing, but libzim only toggles the full-text
index; the title index is always built. Update the docstring to
reflect libzim's actual behaviour and add a regression test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix documentation of config_indexing

1 participant