跳转到主要内容

用于与目录如文本、字段等一起使用的索引

项目描述

zope.index

Latest release Supported Python versions https://github.com/zopefoundation/zope.index/actions/workflows/tests.yml/badge.svg https://coveralls.io/repos/github/zopefoundation/zope.index/badge.svg?branch=master Documentation Status

zope.index软件包为Zope目录提供几个索引。包括

  • 字段索引(用于索引可排序的值),

  • 关键词索引,

  • 主题索引,

  • 文本索引(支持词典、分割器、规范化器等)

变更

7.0 (2024-09-18)

6.1 (2024-02-02)

  • 添加对Python 3.12的支持。

  • 从3.13a3开始添加对Python 3.13的初步支持。

  • 修复Python 3.10+中的OkapiIndex._search_wids错误,当单词包含在超过10个文档中时发生。#48

6.0 (2023-03-24)

  • 添加对Python 3.11的支持。

  • 添加对Python 3.12a5的初步支持。

  • 停止对Python 2.7、3.5、3.6的支持。

5.2.1 (2022-09-15)

  • 在C代码中禁用不安全的数学优化。见请求40

5.2.0 (2022-04-06)

  • 添加对Python 3.10的支持。

5.1.0 (2021-07-19)

  • 添加对Python 3.9的支持。

  • 构建aarch64轮子。

5.0.0 (2019-11-12)

  • 修复 zope.index.text.ricecode.decode_deltas(..., [])。参见 问题 22

  • 放弃对 Python 3.4 的支持。

  • 添加对 Python 3.8 的支持。

4.4.0 (2018-10-05)

  • 放弃对 Python 3.3 的支持。

  • 添加对 Python 3.7 的支持。现在 SortingIndexMixin.sort 仅返回值,而不是抛出所需的 StopIteration,如 PEP 479 所规定。参见 问题 20

  • 文档现在托管在 https://zopeindex.readthedocs.io/

  • 放弃对 setup.py test 的支持。

  • 移除一些从未移植到 Python 3 的内部测试脚本。

  • 达到并维持 100% 的测试覆盖率。

4.3.0 (2017-04-24)

  • None 现在是字段索引中的有效值。这需要 BTrees >= 4.4.1。

  • 当值无法存储在 BTree 中时,允许从字段索引中传播 TypeError。之前它被静默忽略,因为这些值通常被认为是 None

  • 添加对 Python 3.6 的支持。参见 问题 8

  • 在 Python 3 下使文本索引得分的 C 实现可导入(zope.text.index.okascore)。以前我们会回退到纯 Python 实现。参见 问题 14

  • 打包:分发 manylinux 轮和 Windows 轮。

4.2.0 (2016-06-10)

  • 放弃对 Python 2.6 的支持。

  • 添加对 Python 3.5 的支持。

4.1.0 (2014-12-27)

  • 添加对 PyPy 的支持。(PyPy3 正在等待修复:[https://bitbucket.org/pypy/pypy/issue/1946](https://bitbucket.org/pypy/pypy/issue/1946))

  • 添加对 Python 3.4 的支持。

  • 添加在 Travis 上进行测试的支持。

4.0.1 (2013-02-28)

  • 添加被遗忘的依赖项 six。修复 问题 1

4.0.0 (2013-02-25)

  • 添加对 Python 3.3 的支持。

  • 用等效的 zope.interface.implementer 装饰器替换废弃的 zope.interface.implements 使用。

  • 放弃对 Python 2.4 和 2.5 的支持。

3.6.4 (2012-03-12)

  • 确保当使用空序列调用 index_doc 时,索引行为正确。

  • 使用标准的 Python doctest 模块而不是 zope.testing.doctest

3.6.3 (2011-12-03)

  • KeywordIndex:进行小的优化;使用 __nonzero__ 而不是 __len__ 来避免加载整个 TreeSet。

3.6.2 (2011-12-03)

  • KeywordIndex:当匹配一个单词的文档数量达到可配置的阈值(默认 64)时,将 docids 存储在 TreeSet 而不是 Set 中。此规则在索引时间应用于单个单词,但您可以通过调用新的 optimize 方法来一次优化索引中的所有单词。设计用于修复 LP #881950。

3.6.1 (2010-07-08)

  • TextIndex:如果传递,则重用底层 Okapi / Cosine 索引的词典。(LP #232516)

  • Lexicon:在索引 None 时避免抛出异常。(LP #598776)

3.6.0 (2009-08-03)

  • 改进测试的可读性并达到 100% 的测试覆盖率。

  • 修复了 okascore.c 中的破坏性优化:它将 Python 浮点数传递给 PyInt_AS_LONG() 宏。这导致了错误的得分,尤其是在 64 位平台上,所有得分通常都变为零。

  • 将 okascore.c 修改为产生与其 Python 等价物的相同结果,减少了文本索引测试的脆弱性。

3.5.2 (2009-06-09)

  • 将 Zope2 目录实现中使用的 okascore.c 优化移植到 okapiiindex。此模块根据您的环境是否有可工作的 C 编译器有条件地编译。

  • 不要在 okapiindex _search_wids 方法中使用 len(self._docweight)(在规模上获取 BTree 的长度非常昂贵)。而是使用 self.documentCount()。也是 Zope2 的移植。

3.5.1 (2009-02-27)

  • 基础索引、Okapi索引和词典使用了各种长度的普通计数器,这不适合生产应用。从Zope2索引中回溯代码,该代码利用机会将计数器替换为BTree.Length对象。

  • 从Zope2文本索引回溯baseindex._del_wordinfo的非疯狂版本。这通过几个数量级提高了删除性能。

  • 不要在KeywordIndex.apply方法中修改给定的查询字典。

  • 将FieldIndex的排序功能移动到混合类中,以便它可以被zc.catalog的ValueIndex重用。

3.5.0 (2008-12-30)

  • 从依赖中移除zope.testing,因为它实际上并不需要。

  • 为支持排序的索引定义IIndexSort接口。

  • 为FieldIndex实现排序(从repoze.catalog/ZCatalog适配)。

  • 为KeywordIndex/TopicIndex添加一个apply方法,使它们实现IIndexSearch,这在目录中可能很有用。

  • 通过使用多联合和排序来优化KeywordIndex/TopicIndex的search方法,在交集之前进行and操作。

  • 重要:KeywordIndex/TopicIndex现在使用IFSets而不是IISets。这使得它与其他索引(例如,在目录中使用时)更加兼容。如果您的代码以某种方式依赖于集合的II性质,如之前那样,则此更改可能导致问题。

    此外,FilteredSets过去也使用IFSets,如果您在数据库中有任何被序列化的FilteredSets,您需要自己将它们迁移到IFSets。您可以这样操作

    filter._ids = filter.family.IF.Set(filter._ids)

    其中filter是FilteredSet的实例。

  • 重要:KeywordIndex现在是非规范的。因为它对非字符串关键字很有用,其中大小写规范化没有意义。相反,它提供了一个可以由子类覆盖以提供一些规范化的normalize方法。

    现在提供了CaseInsensitiveKeywordIndex类,它对基于字符串的关键字进行大小写规范化。旧的CaseSensitiveKeywordIndex已消失,应用程序应使用KeywordIndex。

看起来KeywordIndex/TopicIndex有点被遗弃了,并且没有被应用程序开发者使用,所以我们经过一些讨论后决定对其进行重构,使其更易于使用、更优化和与其他索引和目录兼容。

从旧KeywordIndex/TopicIndex迁移到新的是一个相当简单的过程,如上所述,所以我们相信这不会是问题。如果您在迁移过程中遇到任何问题,请使用zope3-users@zope.orgzope-dev@zope.org邮件列表。

感谢repoze的Chris McDonough对支持和有用代码的支持。

3.4.1 (2007-09-28)

  • 修复了包元数据中的错误(错误的首页URL)。

3.4.0 (2007-09-28)

自3.4.0a1以来没有进一步的更改。

3.4.0a1(2007-04-22)

作为一个独立项目的初始发布,对应于Zope 3.4.0a1中的zope.index

下载文件

下载适用于您平台上的文件。如果您不确定选择哪个,请了解更多关于安装软件包的信息。

源代码分布

zope_index-7.0.tar.gz (76.7 kB 查看哈希值)

上传时间: 源代码

构建分布

zope.index-7.0-cp313-cp313-win_amd64.whl (95.8 kB 查看哈希值)

上传时间: CPython 3.13 Windows x86-64

zope.index-7.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (101.3 kB 查看哈希值)

上传时间: CPython 3.13 manylinux: glibc 2.17+ ARM64

zope.index-7.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (100.7 kB 查看哈希值)

上传时间: CPython 3.13 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

zope.index-7.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (100.3 kB 查看哈希值)

上传时间: CPython 3.13 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

zope.index-7.0-cp313-cp313-macosx_11_0_arm64.whl (91.9 kB 查看哈希值)

上传时间: CPython 3.13 macOS 11.0+ ARM64

zope.index-7.0-cp313-cp313-macosx_10_9_x86_64.whl (91.4 kB 查看哈希值)

上传时间: CPython 3.13 macOS 10.9+ x86-64

zope.index-7.0-cp312-cp312-win_amd64.whl (95.8 kB 查看哈希值)

上传时间: CPython 3.12 Windows x86-64

zope.index-7.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (101.3 kB 查看哈希值)

上传时间: CPython 3.12 manylinux: glibc 2.17+ ARM64

zope.index-7.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (100.7 kB 查看哈希值)

上传于 CPython 3.12 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

zope.index-7.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (100.3 kB 查看哈希)

上传于 CPython 3.12 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

zope.index-7.0-cp312-cp312-macosx_11_0_arm64.whl (91.9 kB 查看哈希)

上传于 CPython 3.12 macOS 11.0+ ARM64

zope.index-7.0-cp312-cp312-macosx_10_9_x86_64.whl (91.4 kB 查看哈希)

上传于 CPython 3.12 macOS 10.9+ x86-64

zope.index-7.0-cp311-cp311-win_amd64.whl (95.8 kB 查看哈希)

上传于 CPython 3.11 Windows x86-64

zope.index-7.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (100.8 kB 查看哈希)

上传于 CPython 3.11 manylinux: glibc 2.17+ ARM64

zope.index-7.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (100.2 kB 查看哈希)

上传于 CPython 3.11 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

zope.index-7.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (100.1 kB 查看哈希)

上传于 CPython 3.11 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

zope.index-7.0-cp311-cp311-macosx_11_0_arm64.whl (91.9 kB 查看哈希)

上传于 CPython 3.11 macOS 11.0+ ARM64

zope.index-7.0-cp311-cp311-macosx_10_9_x86_64.whl (91.4 kB 查看哈希)

上传于 CPython 3.11 macOS 10.9+ x86-64

zope.index-7.0-cp310-cp310-win_amd64.whl (95.8 kB 查看哈希值)

上传时间 CPython 3.10 Windows x86-64

zope.index-7.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (100.6 kB 查看哈希值)

上传时间 CPython 3.10 manylinux: glibc 2.17+ ARM64

zope.index-7.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (100.0 kB 查看哈希值)

上传时间 CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

zope.index-7.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (99.8 kB 查看哈希值)

上传时间 CPython 3.10 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

zope.index-7.0-cp310-cp310-macosx_11_0_arm64.whl (91.9 kB 查看哈希值)

上传时间 CPython 3.10 macOS 11.0+ ARM64

zope.index-7.0-cp310-cp310-macosx_10_9_x86_64.whl (91.4 kB 查看哈希值)

上传时间 CPython 3.10 macOS 10.9+ x86-64

zope.index-7.0-cp39-cp39-win_amd64.whl (95.8 kB 查看哈希值)

上传时间 CPython 3.9 Windows x86-64

zope.index-7.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (100.4 kB 查看哈希值)

上传时间 CPython 3.9 manylinux: glibc 2.17+ ARM64

zope.index-7.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (99.8 kB 查看哈希值)

上传时间 CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

zope.index-7.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (99.7 kB 查看哈希值)

上传时间 CPython 3.9 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

zope.index-7.0-cp39-cp39-macosx_11_0_arm64.whl (91.8 kB 查看哈希值)

上传于 CPython 3.9 macOS 11.0+ ARM64

zope.index-7.0-cp39-cp39-macosx_10_9_x86_64.whl (91.4 kB 查看哈希值)

上传于 CPython 3.9 macOS 10.9+ x86-64

zope.index-7.0-cp38-cp38-win_amd64.whl (95.8 kB 查看哈希值)

上传于 CPython 3.8 Windows x86-64

zope.index-7.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (101.1 kB 查看哈希值)

上传于 CPython 3.8 manylinux: glibc 2.17+ ARM64

zope.index-7.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (100.5 kB 查看哈希值)

上传于 CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

zope.index-7.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (100.3 kB 查看哈希值)

上传于 CPython 3.8 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

zope.index-7.0-cp38-cp38-macosx_11_0_arm64.whl (91.8 kB 查看哈希值)

上传于 CPython 3.8 macOS 11.0+ ARM64

zope.index-7.0-cp38-cp38-macosx_10_9_x86_64.whl (91.4 kB 查看哈希值)

上传于 CPython 3.8 macOS 10.9+ x86-64

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面