whoosh-ng 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- whoosh_ng-1.0.0/LICENSE.txt +26 -0
- whoosh_ng-1.0.0/MANIFEST.in +8 -0
- whoosh_ng-1.0.0/PKG-INFO +307 -0
- whoosh_ng-1.0.0/README.md +228 -0
- whoosh_ng-1.0.0/benchmark/dcvgr10.txt.gz +0 -0
- whoosh_ng-1.0.0/benchmark/dictionary.py +46 -0
- whoosh_ng-1.0.0/benchmark/enron.py +194 -0
- whoosh_ng-1.0.0/benchmark/marc21.py +366 -0
- whoosh_ng-1.0.0/benchmark/reuters.py +42 -0
- whoosh_ng-1.0.0/benchmark/reuters21578.txt.gz +0 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/analysis.rst +326 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/analysis.rst +61 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/api.rst +9 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/codec/base.rst +30 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/collectors.rst +42 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/columns.rst +48 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/fields.rst +41 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/filedb/filestore.rst +31 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/filedb/filetables.rst +22 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/filedb/structfile.rst +14 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/formats.rst +22 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/highlight.rst +50 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/idsets.rst +23 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/index.rst +39 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/lang/morph_en.rst +7 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/lang/porter.rst +7 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/lang/wordnet.rst +19 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/matching.rst +34 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/qparser.rst +90 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/query.rst +83 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/reading.rst +21 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/scoring.rst +38 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/searching.rst +32 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/sorting.rst +46 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/spelling.rst +29 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/support/charset.rst +12 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/support/levenshtein.rst +9 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/util.rst +6 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/api/writing.rst +28 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/batch.rst +108 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/conf.py +213 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/dates.rst +198 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/facets.rst +769 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/fieldcaches.rst +46 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/glossary.rst +64 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/highlight.rst +407 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/index.rst +49 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/indexing.rst +440 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/intro.rst +60 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/keywords.rst +93 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/nested.rst +237 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/ngrams.rst +48 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/parsing.rst +432 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/query.rst +9 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/querylang.rst +188 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/quickstart.rst +243 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/recipes.rst +228 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/releases/0_3.rst +61 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/releases/1_0.rst +481 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/releases/2_0.rst +330 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/releases/index.rst +10 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/schema.rst +373 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/searching.rst +394 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/spelling.rst +130 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/stemming.rst +203 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/tech/backend.rst +175 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/tech/filedb.rst +28 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/tech/index.rst +9 -0
- whoosh_ng-1.0.0/docs/archive/sphinx/threads.rst +71 -0
- whoosh_ng-1.0.0/files/whoosh.svg +434 -0
- whoosh_ng-1.0.0/files/whoosh_16.png +0 -0
- whoosh_ng-1.0.0/files/whoosh_35.png +0 -0
- whoosh_ng-1.0.0/files/whoosh_64.png +0 -0
- whoosh_ng-1.0.0/files/whoosh_small.svg +604 -0
- whoosh_ng-1.0.0/llms-full.txt +9280 -0
- whoosh_ng-1.0.0/llms.txt +81 -0
- whoosh_ng-1.0.0/pyproject.toml +313 -0
- whoosh_ng-1.0.0/setup.cfg +4 -0
- whoosh_ng-1.0.0/setup.py +4 -0
- whoosh_ng-1.0.0/src/whoosh/__init__.py +56 -0
- whoosh_ng-1.0.0/src/whoosh/analysis/__init__.py +108 -0
- whoosh_ng-1.0.0/src/whoosh/analysis/acore.py +151 -0
- whoosh_ng-1.0.0/src/whoosh/analysis/analyzers.py +311 -0
- whoosh_ng-1.0.0/src/whoosh/analysis/filters.py +515 -0
- whoosh_ng-1.0.0/src/whoosh/analysis/intraword.py +496 -0
- whoosh_ng-1.0.0/src/whoosh/analysis/morph.py +266 -0
- whoosh_ng-1.0.0/src/whoosh/analysis/ngrams.py +250 -0
- whoosh_ng-1.0.0/src/whoosh/analysis/tokenizers.py +358 -0
- whoosh_ng-1.0.0/src/whoosh/automata/__init__.py +0 -0
- whoosh_ng-1.0.0/src/whoosh/automata/fsa.py +704 -0
- whoosh_ng-1.0.0/src/whoosh/automata/fst.py +1562 -0
- whoosh_ng-1.0.0/src/whoosh/automata/glob.py +89 -0
- whoosh_ng-1.0.0/src/whoosh/automata/lev.py +27 -0
- whoosh_ng-1.0.0/src/whoosh/automata/reg.py +126 -0
- whoosh_ng-1.0.0/src/whoosh/backends/__init__.py +14 -0
- whoosh_ng-1.0.0/src/whoosh/backends/abc.py +69 -0
- whoosh_ng-1.0.0/src/whoosh/backends/file.py +84 -0
- whoosh_ng-1.0.0/src/whoosh/backends/sqlite.py +463 -0
- whoosh_ng-1.0.0/src/whoosh/classify.py +379 -0
- whoosh_ng-1.0.0/src/whoosh/codec/__init__.py +32 -0
- whoosh_ng-1.0.0/src/whoosh/codec/base.py +866 -0
- whoosh_ng-1.0.0/src/whoosh/codec/memory.py +332 -0
- whoosh_ng-1.0.0/src/whoosh/codec/plaintext.py +456 -0
- whoosh_ng-1.0.0/src/whoosh/codec/whoosh2.py +2253 -0
- whoosh_ng-1.0.0/src/whoosh/codec/whoosh3.py +1342 -0
- whoosh_ng-1.0.0/src/whoosh/collectors.py +1175 -0
- whoosh_ng-1.0.0/src/whoosh/columns.py +1414 -0
- whoosh_ng-1.0.0/src/whoosh/event_bus.py +72 -0
- whoosh_ng-1.0.0/src/whoosh/externalsort.py +235 -0
- whoosh_ng-1.0.0/src/whoosh/fields.py +1663 -0
- whoosh_ng-1.0.0/src/whoosh/filedb/__init__.py +0 -0
- whoosh_ng-1.0.0/src/whoosh/filedb/compound.py +337 -0
- whoosh_ng-1.0.0/src/whoosh/filedb/fileindex.py +604 -0
- whoosh_ng-1.0.0/src/whoosh/filedb/filepostings.py +463 -0
- whoosh_ng-1.0.0/src/whoosh/filedb/filereading.py +239 -0
- whoosh_ng-1.0.0/src/whoosh/filedb/filestore.py +674 -0
- whoosh_ng-1.0.0/src/whoosh/filedb/filetables.py +736 -0
- whoosh_ng-1.0.0/src/whoosh/filedb/filewriting.py +298 -0
- whoosh_ng-1.0.0/src/whoosh/filedb/gae.py +164 -0
- whoosh_ng-1.0.0/src/whoosh/filedb/misc.py +47 -0
- whoosh_ng-1.0.0/src/whoosh/filedb/pools.py +464 -0
- whoosh_ng-1.0.0/src/whoosh/filedb/structfile.py +410 -0
- whoosh_ng-1.0.0/src/whoosh/formats.py +482 -0
- whoosh_ng-1.0.0/src/whoosh/highlight.py +1106 -0
- whoosh_ng-1.0.0/src/whoosh/hooks.py +49 -0
- whoosh_ng-1.0.0/src/whoosh/idsets.py +947 -0
- whoosh_ng-1.0.0/src/whoosh/index.py +721 -0
- whoosh_ng-1.0.0/src/whoosh/lang/__init__.py +169 -0
- whoosh_ng-1.0.0/src/whoosh/lang/dmetaphone.py +489 -0
- whoosh_ng-1.0.0/src/whoosh/lang/isri.py +440 -0
- whoosh_ng-1.0.0/src/whoosh/lang/lovins.py +574 -0
- whoosh_ng-1.0.0/src/whoosh/lang/morph_en.py +1145 -0
- whoosh_ng-1.0.0/src/whoosh/lang/paicehusk.py +251 -0
- whoosh_ng-1.0.0/src/whoosh/lang/phonetic.py +117 -0
- whoosh_ng-1.0.0/src/whoosh/lang/porter.py +180 -0
- whoosh_ng-1.0.0/src/whoosh/lang/porter2.py +346 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/__init__.py +74 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/bases.py +132 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/danish.py +159 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/dutch.py +180 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/english.py +513 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/finnish.py +349 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/french.py +491 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/german.py +149 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/hungarian.py +419 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/italian.py +369 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/norwegian.py +119 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/portugese.py +335 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/romanian.py +482 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/russian.py +830 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/spanish.py +406 -0
- whoosh_ng-1.0.0/src/whoosh/lang/snowball/swedish.py +109 -0
- whoosh_ng-1.0.0/src/whoosh/lang/stopwords.py +296 -0
- whoosh_ng-1.0.0/src/whoosh/lang/wordnet.py +241 -0
- whoosh_ng-1.0.0/src/whoosh/legacy.py +81 -0
- whoosh_ng-1.0.0/src/whoosh/matching/__init__.py +58 -0
- whoosh_ng-1.0.0/src/whoosh/matching/binary.py +794 -0
- whoosh_ng-1.0.0/src/whoosh/matching/combo.py +313 -0
- whoosh_ng-1.0.0/src/whoosh/matching/mcore.py +625 -0
- whoosh_ng-1.0.0/src/whoosh/matching/wrappers.py +575 -0
- whoosh_ng-1.0.0/src/whoosh/middleware/__init__.py +32 -0
- whoosh_ng-1.0.0/src/whoosh/middleware/base.py +132 -0
- whoosh_ng-1.0.0/src/whoosh/middleware/chain.py +137 -0
- whoosh_ng-1.0.0/src/whoosh/middleware/context.py +41 -0
- whoosh_ng-1.0.0/src/whoosh/middleware/exceptions.py +18 -0
- whoosh_ng-1.0.0/src/whoosh/middleware/integration.py +45 -0
- whoosh_ng-1.0.0/src/whoosh/middleware/metrics.py +64 -0
- whoosh_ng-1.0.0/src/whoosh/middleware/registry.py +37 -0
- whoosh_ng-1.0.0/src/whoosh/middleware/wrappers.py +147 -0
- whoosh_ng-1.0.0/src/whoosh/multiproc.py +388 -0
- whoosh_ng-1.0.0/src/whoosh/plugins/__init__.py +3 -0
- whoosh_ng-1.0.0/src/whoosh/plugins/manager.py +138 -0
- whoosh_ng-1.0.0/src/whoosh/plugins/storage_base.py +63 -0
- whoosh_ng-1.0.0/src/whoosh/plugins/vector_base.py +32 -0
- whoosh_ng-1.0.0/src/whoosh/providers/__init__.py +18 -0
- whoosh_ng-1.0.0/src/whoosh/providers/hnsw.py +111 -0
- whoosh_ng-1.0.0/src/whoosh/py.typed +0 -0
- whoosh_ng-1.0.0/src/whoosh/qparser/__init__.py +78 -0
- whoosh_ng-1.0.0/src/whoosh/qparser/common.py +61 -0
- whoosh_ng-1.0.0/src/whoosh/qparser/dateparse.py +963 -0
- whoosh_ng-1.0.0/src/whoosh/qparser/default.py +442 -0
- whoosh_ng-1.0.0/src/whoosh/qparser/plugins.py +1424 -0
- whoosh_ng-1.0.0/src/whoosh/qparser/syntax.py +650 -0
- whoosh_ng-1.0.0/src/whoosh/qparser/taggers.py +95 -0
- whoosh_ng-1.0.0/src/whoosh/query/__init__.py +86 -0
- whoosh_ng-1.0.0/src/whoosh/query/compound.py +651 -0
- whoosh_ng-1.0.0/src/whoosh/query/nested.py +414 -0
- whoosh_ng-1.0.0/src/whoosh/query/positional.py +275 -0
- whoosh_ng-1.0.0/src/whoosh/query/qcolumns.py +118 -0
- whoosh_ng-1.0.0/src/whoosh/query/qcore.py +738 -0
- whoosh_ng-1.0.0/src/whoosh/query/ranges.py +451 -0
- whoosh_ng-1.0.0/src/whoosh/query/spans.py +922 -0
- whoosh_ng-1.0.0/src/whoosh/query/terms.py +559 -0
- whoosh_ng-1.0.0/src/whoosh/query/wrappers.py +194 -0
- whoosh_ng-1.0.0/src/whoosh/reading.py +1305 -0
- whoosh_ng-1.0.0/src/whoosh/registry/__init__.py +20 -0
- whoosh_ng-1.0.0/src/whoosh/registry/base.py +34 -0
- whoosh_ng-1.0.0/src/whoosh/scoring.py +626 -0
- whoosh_ng-1.0.0/src/whoosh/searching.py +1688 -0
- whoosh_ng-1.0.0/src/whoosh/sorting.py +1136 -0
- whoosh_ng-1.0.0/src/whoosh/spelling.py +343 -0
- whoosh_ng-1.0.0/src/whoosh/support/__init__.py +0 -0
- whoosh_ng-1.0.0/src/whoosh/support/base85.py +101 -0
- whoosh_ng-1.0.0/src/whoosh/support/bench.py +759 -0
- whoosh_ng-1.0.0/src/whoosh/support/bitstream.py +69 -0
- whoosh_ng-1.0.0/src/whoosh/support/bitvector.py +490 -0
- whoosh_ng-1.0.0/src/whoosh/support/charset.py +1374 -0
- whoosh_ng-1.0.0/src/whoosh/support/levenshtein.py +71 -0
- whoosh_ng-1.0.0/src/whoosh/support/pyparsing.py +4198 -0
- whoosh_ng-1.0.0/src/whoosh/support/relativedelta.py +491 -0
- whoosh_ng-1.0.0/src/whoosh/support/unicode.py +532 -0
- whoosh_ng-1.0.0/src/whoosh/system.py +76 -0
- whoosh_ng-1.0.0/src/whoosh/util/__init__.py +141 -0
- whoosh_ng-1.0.0/src/whoosh/util/cache.py +99 -0
- whoosh_ng-1.0.0/src/whoosh/util/filelock.py +161 -0
- whoosh_ng-1.0.0/src/whoosh/util/loading.py +82 -0
- whoosh_ng-1.0.0/src/whoosh/util/numeric.py +605 -0
- whoosh_ng-1.0.0/src/whoosh/util/numlists.py +631 -0
- whoosh_ng-1.0.0/src/whoosh/util/testing.py +131 -0
- whoosh_ng-1.0.0/src/whoosh/util/text.py +135 -0
- whoosh_ng-1.0.0/src/whoosh/util/times.py +509 -0
- whoosh_ng-1.0.0/src/whoosh/util/varints.py +102 -0
- whoosh_ng-1.0.0/src/whoosh/util/versions.py +169 -0
- whoosh_ng-1.0.0/src/whoosh/utils/__init__.py +15 -0
- whoosh_ng-1.0.0/src/whoosh/utils/async_utils.py +75 -0
- whoosh_ng-1.0.0/src/whoosh/vector/__init__.py +16 -0
- whoosh_ng-1.0.0/src/whoosh/vector/base.py +47 -0
- whoosh_ng-1.0.0/src/whoosh/writing.py +1322 -0
- whoosh_ng-1.0.0/src/whoosh_admin/__init__.py +41 -0
- whoosh_ng-1.0.0/src/whoosh_fastapi/__init__.py +65 -0
- whoosh_ng-1.0.0/src/whoosh_modern/__init__.py +10 -0
- whoosh_ng-1.0.0/src/whoosh_modern/autocomplete/__init__.py +5 -0
- whoosh_ng-1.0.0/src/whoosh_modern/autocomplete/edge_ngram.py +29 -0
- whoosh_ng-1.0.0/src/whoosh_modern/autocomplete/factory.py +10 -0
- whoosh_ng-1.0.0/src/whoosh_modern/autocomplete/plugin.py +27 -0
- whoosh_ng-1.0.0/src/whoosh_modern/autocomplete/provider.py +18 -0
- whoosh_ng-1.0.0/src/whoosh_modern/vector/__init__.py +10 -0
- whoosh_ng-1.0.0/src/whoosh_modern/vector/numpy_provider.py +57 -0
- whoosh_ng-1.0.0/src/whoosh_modern/vector/plugin.py +16 -0
- whoosh_ng-1.0.0/src/whoosh_ng.egg-info/PKG-INFO +307 -0
- whoosh_ng-1.0.0/src/whoosh_ng.egg-info/SOURCES.txt +293 -0
- whoosh_ng-1.0.0/src/whoosh_ng.egg-info/dependency_links.txt +1 -0
- whoosh_ng-1.0.0/src/whoosh_ng.egg-info/entry_points.txt +6 -0
- whoosh_ng-1.0.0/src/whoosh_ng.egg-info/requires.txt +65 -0
- whoosh_ng-1.0.0/src/whoosh_ng.egg-info/top_level.txt +4 -0
- whoosh_ng-1.0.0/tests/benchmark_async.py +25 -0
- whoosh_ng-1.0.0/tests/english-words.10.gz +0 -0
- whoosh_ng-1.0.0/tests/test_analysis.py +638 -0
- whoosh_ng-1.0.0/tests/test_automata.py +353 -0
- whoosh_ng-1.0.0/tests/test_backends.py +136 -0
- whoosh_ng-1.0.0/tests/test_bits.py +195 -0
- whoosh_ng-1.0.0/tests/test_classify.py +164 -0
- whoosh_ng-1.0.0/tests/test_codecs.py +707 -0
- whoosh_ng-1.0.0/tests/test_collector.py +261 -0
- whoosh_ng-1.0.0/tests/test_columns.py +488 -0
- whoosh_ng-1.0.0/tests/test_compound.py +62 -0
- whoosh_ng-1.0.0/tests/test_dateparse.py +462 -0
- whoosh_ng-1.0.0/tests/test_event_bus.py +73 -0
- whoosh_ng-1.0.0/tests/test_fastapi_async.py +54 -0
- whoosh_ng-1.0.0/tests/test_fastapi_plugin.py +12 -0
- whoosh_ng-1.0.0/tests/test_fields.py +705 -0
- whoosh_ng-1.0.0/tests/test_flexible.py +101 -0
- whoosh_ng-1.0.0/tests/test_highlighting.py +340 -0
- whoosh_ng-1.0.0/tests/test_hooks.py +73 -0
- whoosh_ng-1.0.0/tests/test_indexing.py +793 -0
- whoosh_ng-1.0.0/tests/test_matching.py +588 -0
- whoosh_ng-1.0.0/tests/test_middleware.py +210 -0
- whoosh_ng-1.0.0/tests/test_middleware_async.py +63 -0
- whoosh_ng-1.0.0/tests/test_misc.py +135 -0
- whoosh_ng-1.0.0/tests/test_modern_autocomplete.py +37 -0
- whoosh_ng-1.0.0/tests/test_modern_vector.py +71 -0
- whoosh_ng-1.0.0/tests/test_mpwriter.py +287 -0
- whoosh_ng-1.0.0/tests/test_nested.py +402 -0
- whoosh_ng-1.0.0/tests/test_parse_plugins.py +686 -0
- whoosh_ng-1.0.0/tests/test_parsing.py +1085 -0
- whoosh_ng-1.0.0/tests/test_plugin_manager.py +86 -0
- whoosh_ng-1.0.0/tests/test_plugin_manager_async.py +46 -0
- whoosh_ng-1.0.0/tests/test_postings.py +139 -0
- whoosh_ng-1.0.0/tests/test_provider_architecture.py +132 -0
- whoosh_ng-1.0.0/tests/test_providers.py +33 -0
- whoosh_ng-1.0.0/tests/test_quality.py +167 -0
- whoosh_ng-1.0.0/tests/test_queries.py +874 -0
- whoosh_ng-1.0.0/tests/test_reading.py +568 -0
- whoosh_ng-1.0.0/tests/test_registry.py +59 -0
- whoosh_ng-1.0.0/tests/test_results.py +691 -0
- whoosh_ng-1.0.0/tests/test_run_sync.py +76 -0
- whoosh_ng-1.0.0/tests/test_searching.py +1844 -0
- whoosh_ng-1.0.0/tests/test_sorting.py +1147 -0
- whoosh_ng-1.0.0/tests/test_spans.py +369 -0
- whoosh_ng-1.0.0/tests/test_spelling.py +387 -0
- whoosh_ng-1.0.0/tests/test_stem.py +31 -0
- whoosh_ng-1.0.0/tests/test_tables.py +238 -0
- whoosh_ng-1.0.0/tests/test_vectors.py +137 -0
- whoosh_ng-1.0.0/tests/test_weightings.py +86 -0
- whoosh_ng-1.0.0/tests/test_writing.py +531 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Copyright 2011 Matt Chaput. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
7
|
+
this list of conditions and the following disclaimer.
|
|
8
|
+
|
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
10
|
+
notice, this list of conditions and the following disclaimer in the
|
|
11
|
+
documentation and/or other materials provided with the distribution.
|
|
12
|
+
|
|
13
|
+
THIS SOFTWARE IS PROVIDED BY MATT CHAPUT ``AS IS'' AND ANY EXPRESS OR
|
|
14
|
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
15
|
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
16
|
+
EVENT SHALL MATT CHAPUT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
17
|
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
18
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
|
19
|
+
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
20
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
21
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
|
22
|
+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
23
|
+
|
|
24
|
+
The views and conclusions contained in the software and documentation are
|
|
25
|
+
those of the authors and should not be interpreted as representing official
|
|
26
|
+
policies, either expressed or implied, of Matt Chaput.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
include *.txt
|
|
2
|
+
include benchmark/dcvgr10.txt.gz
|
|
3
|
+
include benchmark/reuters21578.txt.gz
|
|
4
|
+
include tests/english-words.10.gz
|
|
5
|
+
recursive-include tests *.py
|
|
6
|
+
recursive-include benchmark *.py
|
|
7
|
+
recursive-include docs *.txt *.py *.rst
|
|
8
|
+
recursive-include files *.png *.svg
|
whoosh_ng-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: whoosh-ng
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Fast, pure-Python full-text indexing, search, and spell checking library.
|
|
5
|
+
Author-email: David Orel <d.orel@free.fr>
|
|
6
|
+
Maintainer-email: dorel14 <d.orel@free.fr>
|
|
7
|
+
License-Expression: BSD-2-Clause
|
|
8
|
+
Project-URL: Documentation, https://dorel14.github.io/whoosh-ng/
|
|
9
|
+
Project-URL: Homepage, https://github.com/dorel14/whoosh-ng
|
|
10
|
+
Project-URL: Issues, https://github.com/dorel14/whoosh-ng/issues
|
|
11
|
+
Project-URL: Repository, https://github.com/dorel14/whoosh-ng.git
|
|
12
|
+
Project-URL: Changelog, https://github.com/dorel14/whoosh-ng/releases
|
|
13
|
+
Keywords: index,search,text,spell,whoosh
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Classifier: Topic :: Text Processing :: Indexing
|
|
26
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
|
27
|
+
Requires-Python: >=3.11
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE.txt
|
|
30
|
+
Requires-Dist: cached-property>=2.0.1
|
|
31
|
+
Provides-Extra: models
|
|
32
|
+
Requires-Dist: pydantic>=2; extra == "models"
|
|
33
|
+
Requires-Dist: msgspec>=0.19; extra == "models"
|
|
34
|
+
Provides-Extra: vector
|
|
35
|
+
Requires-Dist: numpy>=2; extra == "vector"
|
|
36
|
+
Provides-Extra: hnsw
|
|
37
|
+
Requires-Dist: hnswlib; extra == "hnsw"
|
|
38
|
+
Provides-Extra: faiss
|
|
39
|
+
Requires-Dist: faiss-cpu; extra == "faiss"
|
|
40
|
+
Provides-Extra: embeddings
|
|
41
|
+
Requires-Dist: sentence-transformers; extra == "embeddings"
|
|
42
|
+
Provides-Extra: fastembed
|
|
43
|
+
Requires-Dist: fastembed; extra == "fastembed"
|
|
44
|
+
Provides-Extra: async
|
|
45
|
+
Provides-Extra: sqlite
|
|
46
|
+
Provides-Extra: postgres
|
|
47
|
+
Requires-Dist: psycopg[binary]>=3; extra == "postgres"
|
|
48
|
+
Requires-Dist: asyncpg; extra == "postgres"
|
|
49
|
+
Provides-Extra: s3
|
|
50
|
+
Requires-Dist: boto3; extra == "s3"
|
|
51
|
+
Provides-Extra: watch
|
|
52
|
+
Requires-Dist: watchdog; extra == "watch"
|
|
53
|
+
Provides-Extra: fuzzy
|
|
54
|
+
Requires-Dist: rapidfuzz; extra == "fuzzy"
|
|
55
|
+
Provides-Extra: phonetic
|
|
56
|
+
Requires-Dist: metaphone; extra == "phonetic"
|
|
57
|
+
Provides-Extra: api
|
|
58
|
+
Requires-Dist: fastapi; extra == "api"
|
|
59
|
+
Requires-Dist: uvicorn[standard]; extra == "api"
|
|
60
|
+
Requires-Dist: orjson; extra == "api"
|
|
61
|
+
Provides-Extra: metrics
|
|
62
|
+
Requires-Dist: prometheus-client; extra == "metrics"
|
|
63
|
+
Provides-Extra: dev
|
|
64
|
+
Requires-Dist: ruff>=0.11; extra == "dev"
|
|
65
|
+
Requires-Dist: mypy>=1.15; extra == "dev"
|
|
66
|
+
Requires-Dist: pyright>=1.1; extra == "dev"
|
|
67
|
+
Requires-Dist: pytest>=9; extra == "dev"
|
|
68
|
+
Requires-Dist: pytest-cov>=6; extra == "dev"
|
|
69
|
+
Requires-Dist: pytest-asyncio>=1; extra == "dev"
|
|
70
|
+
Requires-Dist: pre-commit>=4; extra == "dev"
|
|
71
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
72
|
+
Requires-Dist: twine>=6; extra == "dev"
|
|
73
|
+
Requires-Dist: python-semantic-release>=10.5; extra == "dev"
|
|
74
|
+
Requires-Dist: isort>=8.0.1; extra == "dev"
|
|
75
|
+
Requires-Dist: nose>=1.3.7; extra == "dev"
|
|
76
|
+
Requires-Dist: pre-commit>=4.6.0; extra == "dev"
|
|
77
|
+
Provides-Extra: benchmark
|
|
78
|
+
Dynamic: license-file
|
|
79
|
+
|
|
80
|
+
[](https://pypi.org/project/whoosh-ng/)
|
|
81
|
+
[](https://pypi.org/project/whoosh-ng/)
|
|
82
|
+
[](https://pypi.org/project/whoosh-ng/)
|
|
83
|
+
[](https://dorel14.github.io/whoosh-ng/)
|
|
84
|
+
|
|
85
|
+
# Whoosh-NG
|
|
86
|
+
|
|
87
|
+
**Whoosh-Reloaded** is a modern, pure-Python full-text indexing and search library. Version 4.0 brings a complete modernization with Python 3.11+ support, strict type annotations, optional feature profiles, and automated semantic releases.
|
|
88
|
+
|
|
89
|
+
## Quick Start
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
pip install whoosh-ng
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Features
|
|
96
|
+
|
|
97
|
+
- **Pure Python** - No native dependencies, works everywhere Python runs
|
|
98
|
+
- **Full-text search** - BM25/BM25F scoring with phrase queries
|
|
99
|
+
- **Fielded documents** - Structured indexing with typed fields
|
|
100
|
+
- **Query parsing** - Flexible parser with boosting and syntax options
|
|
101
|
+
- **Facets & sorting** - Group and sort results by any field
|
|
102
|
+
- **Highlighting** - Snippet extraction with customizable formatters
|
|
103
|
+
- **Spell checking** - Built-in spelling correction
|
|
104
|
+
- **Event-driven architecture** - Plugin system with hooks and middleware
|
|
105
|
+
- **Optional extensions** - Vector search, async, FastAPI, metrics, and more
|
|
106
|
+
|
|
107
|
+
## Installation
|
|
108
|
+
|
|
109
|
+
### Core Installation
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
pip install whoosh-ng
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Optional Profiles
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Vector search with NumPy
|
|
119
|
+
pip install "whoosh-ng[vector]"
|
|
120
|
+
|
|
121
|
+
# Async wrappers
|
|
122
|
+
pip install "whoosh-ng[async]"
|
|
123
|
+
|
|
124
|
+
# FastAPI REST API integration
|
|
125
|
+
pip install "whoosh-ng[api]"
|
|
126
|
+
|
|
127
|
+
# Prometheus metrics
|
|
128
|
+
pip install "whoosh-ng[metrics]"
|
|
129
|
+
|
|
130
|
+
# PostgreSQL backend
|
|
131
|
+
pip install "whoosh-ng[postgres]"
|
|
132
|
+
|
|
133
|
+
# Fuzzy matching
|
|
134
|
+
pip install "whoosh-ng[fuzzy]"
|
|
135
|
+
|
|
136
|
+
# Phonetic search
|
|
137
|
+
pip install "whoosh-ng[phonetic]"
|
|
138
|
+
|
|
139
|
+
# All optional features
|
|
140
|
+
pip install "whoosh-ng[vector,async,api,metrics,postgres,fuzzy,phonetic]"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Development Installation
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
pip install "whoosh-ng[dev]"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Documentation
|
|
150
|
+
|
|
151
|
+
- **[API Reference](/whoosh-ng/en/api/overview/)** - Complete module documentation
|
|
152
|
+
- **[User Guides](/whoosh-ng/en/guides/)** - Tutorials and best practices
|
|
153
|
+
- **[Examples](/whoosh-ng/en/examples/)** - Runnable code examples
|
|
154
|
+
- **[French Documentation](/whoosh-ng/fr/)** - Documentation en français
|
|
155
|
+
|
|
156
|
+
## Recent Changes in 4.0.0.dev0
|
|
157
|
+
|
|
158
|
+
### Added
|
|
159
|
+
|
|
160
|
+
- **Plugin System** (`whoosh.plugins`): `Plugin` base class and `PluginManager` with entry-point auto-discovery, version validation, conflict detection, enable/disable, and dependency management
|
|
161
|
+
- **Registry System** (`whoosh.registry`): Generic registry plus `StorageRegistry`, `AnalyzerRegistry`, `RankingRegistry`, `SuggestRegistry`, `VectorRegistry`, `AutocompleteRegistry`, and `BackendRegistry`
|
|
162
|
+
- **Middleware Pipeline** (`whoosh.middleware`): `Middleware` base class (sync + async), `MiddlewareContext`, `MiddlewareChain`, `MiddlewareRegistry`, with official `MetricsMiddleware`, `CacheMiddleware`, `CompressionMiddleware`, `EncryptionMiddleware`, and `PrometheusMiddleware`
|
|
163
|
+
- **Event Bus** (`whoosh.event_bus`): `EventBus` with subscribe/publish/clear
|
|
164
|
+
- **Hook System** (`whoosh.hooks`): `hookimpl`, `register_hook`, `call_hook`
|
|
165
|
+
- **Backends**: `Backend` ABC with lifecycle hooks, `FileBackend`, and `SQLiteBackend`
|
|
166
|
+
- **Provider Architecture**: `VectorProvider`/`VectorField`, `NumpyProvider` for vector similarity search
|
|
167
|
+
- **Autocomplete Plugin** (`whoosh_modern.autocomplete`): Inverted index and edge-ngram autocomplete
|
|
168
|
+
- **FastAPI Plugin** (`whoosh_fastapi`): REST endpoints for search, autocomplete, vector search, and health checks
|
|
169
|
+
- **Admin UI Plugin** (`whoosh_admin`): Dashboard for index administration
|
|
170
|
+
- **Entry Points**: Auto-loaded plugins under `whoosh.plugins` group
|
|
171
|
+
|
|
172
|
+
### Changed
|
|
173
|
+
|
|
174
|
+
- Distribution renamed from `whoosh-reloaded` to **`whoosh-ng`** (import namespace remains `whoosh`)
|
|
175
|
+
- Documentation site moved to GitHub Pages: https://dorel14.github.io/whoosh-ng/
|
|
176
|
+
- **Python 3.11+ required** (dropped Python 3.9/3.10 support)
|
|
177
|
+
- Packaging cleaned: consolidated extras in `pyproject.toml`
|
|
178
|
+
- Type annotations modernized: `mypy src/whoosh` reports 0 errors, `py.typed` marker included
|
|
179
|
+
|
|
180
|
+
## Example: Simple Search
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
from whoosh import index
|
|
184
|
+
from whoosh.fields import Schema, TEXT, ID
|
|
185
|
+
from whoosh.qparser import QueryParser
|
|
186
|
+
|
|
187
|
+
# Define schema
|
|
188
|
+
schema = Schema(
|
|
189
|
+
id=ID(stored=True, unique=True),
|
|
190
|
+
title=TEXT(stored=True),
|
|
191
|
+
content=TEXT,
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
# Create index
|
|
195
|
+
ix = index.create_in("my_index", schema)
|
|
196
|
+
|
|
197
|
+
# Index documents
|
|
198
|
+
with ix.writer() as w:
|
|
199
|
+
w.add_document(id="1", title="Hello World", content="Welcome to Whoosh-NG")
|
|
200
|
+
w.add_document(id="2", title="Python Search", content="Fast text search library")
|
|
201
|
+
|
|
202
|
+
# Search
|
|
203
|
+
with ix.searcher() as s:
|
|
204
|
+
qp = QueryParser("content", ix.schema)
|
|
205
|
+
q = qp.parse("search library")
|
|
206
|
+
results = s.search(q)
|
|
207
|
+
for hit in results:
|
|
208
|
+
print(hit["title"], hit.score)
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Example: FastAPI Integration
|
|
212
|
+
|
|
213
|
+
```python
|
|
214
|
+
from fastapi import FastAPI
|
|
215
|
+
from whoosh import index
|
|
216
|
+
from whoosh.fields import Schema, TEXT, ID
|
|
217
|
+
from whoosh_fastapi import create_app
|
|
218
|
+
|
|
219
|
+
schema = Schema(id=ID(), title=TEXT(), content=TEXT())
|
|
220
|
+
ix = index.create_in("docs", schema)
|
|
221
|
+
|
|
222
|
+
# Create FastAPI app with Whoosh-NG endpoints
|
|
223
|
+
app = create_app(ix, prefix="/api/v1")
|
|
224
|
+
|
|
225
|
+
# Endpoints available:
|
|
226
|
+
# GET /api/v1/health - Health check
|
|
227
|
+
# POST /api/v1/search - Full-text search
|
|
228
|
+
# GET /api/v1/autocomplete?q= - Autocomplete suggestions
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Example: Vector Search
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
pip install "whoosh-ng[vector]" numpy
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
```python
|
|
238
|
+
from whoosh.fields import Schema, TEXT, ID, VECTOR
|
|
239
|
+
from whoosh.vector import VectorField
|
|
240
|
+
from whoosh_modern.vector.plugin import VectorPlugin
|
|
241
|
+
from whoosh.plugins.manager import PluginManager
|
|
242
|
+
import numpy as np
|
|
243
|
+
|
|
244
|
+
# Create index with vector field
|
|
245
|
+
schema = Schema(
|
|
246
|
+
id=ID(stored=True),
|
|
247
|
+
title=TEXT(stored=True),
|
|
248
|
+
embedding=VECTOR(dim=384),
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
# Register vector plugin
|
|
252
|
+
VectorPlugin().register(PluginManager())
|
|
253
|
+
|
|
254
|
+
# Index with embeddings
|
|
255
|
+
ix = index.create_in("vector_db", schema)
|
|
256
|
+
with ix.writer() as w:
|
|
257
|
+
w.add_document(
|
|
258
|
+
id="doc1",
|
|
259
|
+
title="Python tutorial",
|
|
260
|
+
embedding=np.random.rand(384).astype(np.float32).tobytes()
|
|
261
|
+
)
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Quality Gates
|
|
265
|
+
|
|
266
|
+
The 4.0 quality policy requires every merged PR to pass:
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
uv run ruff check .
|
|
270
|
+
uv run ruff format --check .
|
|
271
|
+
uv run mypy src/whoosh
|
|
272
|
+
uv run pytest tests
|
|
273
|
+
uv run python -m build
|
|
274
|
+
uv run twine check dist/*
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
CI validates these checks on Windows and Linux before merge.
|
|
278
|
+
|
|
279
|
+
## Development
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# Install uv (if not already)
|
|
283
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
284
|
+
|
|
285
|
+
# Setup
|
|
286
|
+
uv python install 3.11
|
|
287
|
+
uv venv --python 3.11
|
|
288
|
+
uv sync --extra dev
|
|
289
|
+
|
|
290
|
+
# Run tests
|
|
291
|
+
uv run pytest
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
## Contributing
|
|
295
|
+
|
|
296
|
+
Commits follow [Conventional Commits](https://www.conventionalcommits.org/) so `python-semantic-release` can generate versions, changelogs, tags, GitHub releases, and PyPI publications automatically.
|
|
297
|
+
|
|
298
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development guidelines.
|
|
299
|
+
|
|
300
|
+
## Maintainers
|
|
301
|
+
|
|
302
|
+
- [Sygil-Dev Organization](https://github.com/Sygil-Dev)
|
|
303
|
+
- Matt Chaput (original Whoosh author)
|
|
304
|
+
|
|
305
|
+
## License
|
|
306
|
+
|
|
307
|
+
BSD-2-Clause. See [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
[](https://pypi.org/project/whoosh-ng/)
|
|
2
|
+
[](https://pypi.org/project/whoosh-ng/)
|
|
3
|
+
[](https://pypi.org/project/whoosh-ng/)
|
|
4
|
+
[](https://dorel14.github.io/whoosh-ng/)
|
|
5
|
+
|
|
6
|
+
# Whoosh-NG
|
|
7
|
+
|
|
8
|
+
**Whoosh-Reloaded** is a modern, pure-Python full-text indexing and search library. Version 4.0 brings a complete modernization with Python 3.11+ support, strict type annotations, optional feature profiles, and automated semantic releases.
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install whoosh-ng
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- **Pure Python** - No native dependencies, works everywhere Python runs
|
|
19
|
+
- **Full-text search** - BM25/BM25F scoring with phrase queries
|
|
20
|
+
- **Fielded documents** - Structured indexing with typed fields
|
|
21
|
+
- **Query parsing** - Flexible parser with boosting and syntax options
|
|
22
|
+
- **Facets & sorting** - Group and sort results by any field
|
|
23
|
+
- **Highlighting** - Snippet extraction with customizable formatters
|
|
24
|
+
- **Spell checking** - Built-in spelling correction
|
|
25
|
+
- **Event-driven architecture** - Plugin system with hooks and middleware
|
|
26
|
+
- **Optional extensions** - Vector search, async, FastAPI, metrics, and more
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
### Core Installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install whoosh-ng
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Optional Profiles
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Vector search with NumPy
|
|
40
|
+
pip install "whoosh-ng[vector]"
|
|
41
|
+
|
|
42
|
+
# Async wrappers
|
|
43
|
+
pip install "whoosh-ng[async]"
|
|
44
|
+
|
|
45
|
+
# FastAPI REST API integration
|
|
46
|
+
pip install "whoosh-ng[api]"
|
|
47
|
+
|
|
48
|
+
# Prometheus metrics
|
|
49
|
+
pip install "whoosh-ng[metrics]"
|
|
50
|
+
|
|
51
|
+
# PostgreSQL backend
|
|
52
|
+
pip install "whoosh-ng[postgres]"
|
|
53
|
+
|
|
54
|
+
# Fuzzy matching
|
|
55
|
+
pip install "whoosh-ng[fuzzy]"
|
|
56
|
+
|
|
57
|
+
# Phonetic search
|
|
58
|
+
pip install "whoosh-ng[phonetic]"
|
|
59
|
+
|
|
60
|
+
# All optional features
|
|
61
|
+
pip install "whoosh-ng[vector,async,api,metrics,postgres,fuzzy,phonetic]"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Development Installation
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pip install "whoosh-ng[dev]"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Documentation
|
|
71
|
+
|
|
72
|
+
- **[API Reference](/whoosh-ng/en/api/overview/)** - Complete module documentation
|
|
73
|
+
- **[User Guides](/whoosh-ng/en/guides/)** - Tutorials and best practices
|
|
74
|
+
- **[Examples](/whoosh-ng/en/examples/)** - Runnable code examples
|
|
75
|
+
- **[French Documentation](/whoosh-ng/fr/)** - Documentation en français
|
|
76
|
+
|
|
77
|
+
## Recent Changes in 4.0.0.dev0
|
|
78
|
+
|
|
79
|
+
### Added
|
|
80
|
+
|
|
81
|
+
- **Plugin System** (`whoosh.plugins`): `Plugin` base class and `PluginManager` with entry-point auto-discovery, version validation, conflict detection, enable/disable, and dependency management
|
|
82
|
+
- **Registry System** (`whoosh.registry`): Generic registry plus `StorageRegistry`, `AnalyzerRegistry`, `RankingRegistry`, `SuggestRegistry`, `VectorRegistry`, `AutocompleteRegistry`, and `BackendRegistry`
|
|
83
|
+
- **Middleware Pipeline** (`whoosh.middleware`): `Middleware` base class (sync + async), `MiddlewareContext`, `MiddlewareChain`, `MiddlewareRegistry`, with official `MetricsMiddleware`, `CacheMiddleware`, `CompressionMiddleware`, `EncryptionMiddleware`, and `PrometheusMiddleware`
|
|
84
|
+
- **Event Bus** (`whoosh.event_bus`): `EventBus` with subscribe/publish/clear
|
|
85
|
+
- **Hook System** (`whoosh.hooks`): `hookimpl`, `register_hook`, `call_hook`
|
|
86
|
+
- **Backends**: `Backend` ABC with lifecycle hooks, `FileBackend`, and `SQLiteBackend`
|
|
87
|
+
- **Provider Architecture**: `VectorProvider`/`VectorField`, `NumpyProvider` for vector similarity search
|
|
88
|
+
- **Autocomplete Plugin** (`whoosh_modern.autocomplete`): Inverted index and edge-ngram autocomplete
|
|
89
|
+
- **FastAPI Plugin** (`whoosh_fastapi`): REST endpoints for search, autocomplete, vector search, and health checks
|
|
90
|
+
- **Admin UI Plugin** (`whoosh_admin`): Dashboard for index administration
|
|
91
|
+
- **Entry Points**: Auto-loaded plugins under `whoosh.plugins` group
|
|
92
|
+
|
|
93
|
+
### Changed
|
|
94
|
+
|
|
95
|
+
- Distribution renamed from `whoosh-reloaded` to **`whoosh-ng`** (import namespace remains `whoosh`)
|
|
96
|
+
- Documentation site moved to GitHub Pages: https://dorel14.github.io/whoosh-ng/
|
|
97
|
+
- **Python 3.11+ required** (dropped Python 3.9/3.10 support)
|
|
98
|
+
- Packaging cleaned: consolidated extras in `pyproject.toml`
|
|
99
|
+
- Type annotations modernized: `mypy src/whoosh` reports 0 errors, `py.typed` marker included
|
|
100
|
+
|
|
101
|
+
## Example: Simple Search
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
from whoosh import index
|
|
105
|
+
from whoosh.fields import Schema, TEXT, ID
|
|
106
|
+
from whoosh.qparser import QueryParser
|
|
107
|
+
|
|
108
|
+
# Define schema
|
|
109
|
+
schema = Schema(
|
|
110
|
+
id=ID(stored=True, unique=True),
|
|
111
|
+
title=TEXT(stored=True),
|
|
112
|
+
content=TEXT,
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
# Create index
|
|
116
|
+
ix = index.create_in("my_index", schema)
|
|
117
|
+
|
|
118
|
+
# Index documents
|
|
119
|
+
with ix.writer() as w:
|
|
120
|
+
w.add_document(id="1", title="Hello World", content="Welcome to Whoosh-NG")
|
|
121
|
+
w.add_document(id="2", title="Python Search", content="Fast text search library")
|
|
122
|
+
|
|
123
|
+
# Search
|
|
124
|
+
with ix.searcher() as s:
|
|
125
|
+
qp = QueryParser("content", ix.schema)
|
|
126
|
+
q = qp.parse("search library")
|
|
127
|
+
results = s.search(q)
|
|
128
|
+
for hit in results:
|
|
129
|
+
print(hit["title"], hit.score)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Example: FastAPI Integration
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
from fastapi import FastAPI
|
|
136
|
+
from whoosh import index
|
|
137
|
+
from whoosh.fields import Schema, TEXT, ID
|
|
138
|
+
from whoosh_fastapi import create_app
|
|
139
|
+
|
|
140
|
+
schema = Schema(id=ID(), title=TEXT(), content=TEXT())
|
|
141
|
+
ix = index.create_in("docs", schema)
|
|
142
|
+
|
|
143
|
+
# Create FastAPI app with Whoosh-NG endpoints
|
|
144
|
+
app = create_app(ix, prefix="/api/v1")
|
|
145
|
+
|
|
146
|
+
# Endpoints available:
|
|
147
|
+
# GET /api/v1/health - Health check
|
|
148
|
+
# POST /api/v1/search - Full-text search
|
|
149
|
+
# GET /api/v1/autocomplete?q= - Autocomplete suggestions
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Example: Vector Search
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
pip install "whoosh-ng[vector]" numpy
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
from whoosh.fields import Schema, TEXT, ID, VECTOR
|
|
160
|
+
from whoosh.vector import VectorField
|
|
161
|
+
from whoosh_modern.vector.plugin import VectorPlugin
|
|
162
|
+
from whoosh.plugins.manager import PluginManager
|
|
163
|
+
import numpy as np
|
|
164
|
+
|
|
165
|
+
# Create index with vector field
|
|
166
|
+
schema = Schema(
|
|
167
|
+
id=ID(stored=True),
|
|
168
|
+
title=TEXT(stored=True),
|
|
169
|
+
embedding=VECTOR(dim=384),
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
# Register vector plugin
|
|
173
|
+
VectorPlugin().register(PluginManager())
|
|
174
|
+
|
|
175
|
+
# Index with embeddings
|
|
176
|
+
ix = index.create_in("vector_db", schema)
|
|
177
|
+
with ix.writer() as w:
|
|
178
|
+
w.add_document(
|
|
179
|
+
id="doc1",
|
|
180
|
+
title="Python tutorial",
|
|
181
|
+
embedding=np.random.rand(384).astype(np.float32).tobytes()
|
|
182
|
+
)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Quality Gates
|
|
186
|
+
|
|
187
|
+
The 4.0 quality policy requires every merged PR to pass:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
uv run ruff check .
|
|
191
|
+
uv run ruff format --check .
|
|
192
|
+
uv run mypy src/whoosh
|
|
193
|
+
uv run pytest tests
|
|
194
|
+
uv run python -m build
|
|
195
|
+
uv run twine check dist/*
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
CI validates these checks on Windows and Linux before merge.
|
|
199
|
+
|
|
200
|
+
## Development
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# Install uv (if not already)
|
|
204
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
205
|
+
|
|
206
|
+
# Setup
|
|
207
|
+
uv python install 3.11
|
|
208
|
+
uv venv --python 3.11
|
|
209
|
+
uv sync --extra dev
|
|
210
|
+
|
|
211
|
+
# Run tests
|
|
212
|
+
uv run pytest
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Contributing
|
|
216
|
+
|
|
217
|
+
Commits follow [Conventional Commits](https://www.conventionalcommits.org/) so `python-semantic-release` can generate versions, changelogs, tags, GitHub releases, and PyPI publications automatically.
|
|
218
|
+
|
|
219
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development guidelines.
|
|
220
|
+
|
|
221
|
+
## Maintainers
|
|
222
|
+
|
|
223
|
+
- [Sygil-Dev Organization](https://github.com/Sygil-Dev)
|
|
224
|
+
- Matt Chaput (original Whoosh author)
|
|
225
|
+
|
|
226
|
+
## License
|
|
227
|
+
|
|
228
|
+
BSD-2-Clause. See [LICENSE](LICENSE) for details.
|
|
Binary file
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import gzip
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
from whoosh import analysis, fields
|
|
5
|
+
from whoosh.support.bench import Bench, Spec
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class VulgarTongue(Spec):
|
|
9
|
+
name = "dictionary"
|
|
10
|
+
filename = "dcvgr10.txt.gz"
|
|
11
|
+
headline_field = "head"
|
|
12
|
+
|
|
13
|
+
def documents(self):
|
|
14
|
+
path = os.path.join(self.options.dir, self.filename)
|
|
15
|
+
f = gzip.GzipFile(path)
|
|
16
|
+
|
|
17
|
+
head = body = None
|
|
18
|
+
for line in f:
|
|
19
|
+
line = line.decode("latin1")
|
|
20
|
+
if line[0].isalpha():
|
|
21
|
+
if head:
|
|
22
|
+
yield {"head": head, "body": head + body}
|
|
23
|
+
head, body = line.split(".", 1)
|
|
24
|
+
else:
|
|
25
|
+
body += line
|
|
26
|
+
|
|
27
|
+
if head:
|
|
28
|
+
yield {"head": head, "body": head + body}
|
|
29
|
+
|
|
30
|
+
def whoosh_schema(self):
|
|
31
|
+
ana = analysis.StemmingAnalyzer()
|
|
32
|
+
|
|
33
|
+
schema = fields.Schema(
|
|
34
|
+
head=fields.ID(stored=True), body=fields.TEXT(analyzer=ana, stored=True)
|
|
35
|
+
)
|
|
36
|
+
return schema
|
|
37
|
+
|
|
38
|
+
def zcatalog_setup(self, cat):
|
|
39
|
+
from zcatalog import indexes # type: ignore
|
|
40
|
+
|
|
41
|
+
cat["head"] = indexes.FieldIndex(field_name="head")
|
|
42
|
+
cat["body"] = indexes.TextIndex(field_name="body")
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
if __name__ == "__main__":
|
|
46
|
+
Bench().run(VulgarTongue)
|