通过 ZCatalog 总是得到相同的结果?一切都是书上规定的!

发布于 2024-10-01 05:14:31 字数 1964 浏览 0 评论 0原文

这很奇怪,但我无法让 ZCatalog 工作。一切都是按书本完成的,但结果仍然是相同的完整列表。

你可以在这里看到: http://nfp-bg.eionet.eu.int /waste/en/search-results?catalogTextIdx=selection

到目前为止我所做的:

  1. 创建了 ZCatalog 对象
  2. 使用以下项目创建了 ZCTextIndex Lexicon
    • HTMLWordSplitter
    • 案例标准化器
    • 停用词删除器
  3. 创建了catalogTextIdx 索引 - 参数为:
    • 已编入索引的属性名称:PrincipiaSearchSource
    • 指数类型:Okapi BM25 排名
    • 使用的 ZCTextIndex 词典:http://nfp-bg.eionet.eu.int/waste/catalog//catalogTextIdx/catalogLexicon
  4. 收集的元数据为:
    • 原理搜索来源
    • ID
    • 标题
  5. 查找对象仅针对类型为:DTML 文档的对象运行
  6. 为目录正确创建了项目列表(我仅删除了 css / js dtml 文件)
  7. 以下代码用于搜索表单
<form action="search-results" method="get">
    <input type="text" name="catalogTextIdx" id="catalogTextIdx" value="<dtml-if catalogTextIdx>
    <dtml-var catalogTextIdx><dtml-else>Search...</dtml-if>" class="search-field" />
    <input type="submit" name="SUBMIT" value="Submit Query" class="button" />
</form>

:以下代码用于搜索结果页面:

<dtml-with common>&dtml.-Header;&dtml.-left-column;</dtml-with>
<td id="content" valign="top">
    <h2>Search Results</h2>

    <dtml-in expr="catalog(meta_type=['DTML Document'])">
        <h3>Result founded: <a href="<dtml-var "catalog.getpath(data_record_id_)">"><dtml-var title></a></h3>
        <dtml-var "filterRenderedHTML(PrincipiaSearchSource)">
    </dtml-in>
</td>
<dtml-with common>&dtml.-right-column;&dtml.-Footer;</dtml-with>

它应该可以工作,但事实并非如此。我相信这应该是小事,但仍不确定。

预先感谢您的所有帮助。

It is strange, but I can't get the ZCatalog working. Everything is done by the book and still the results are always the same full list.

You can see here:
http://nfp-bg.eionet.eu.int/waste/en/search-results?catalogTextIdx=selection

What I have done so far:

  1. Created ZCatalog Object
  2. Created ZCTextIndex Lexicon with the following items
    • HTMLWordSplitter
    • CaseNormalizer
    • StopWordRemover
  3. Created catalogTextIdx Index - the parameters are:
    • Name(s) of attribute(s) indexed: PrincipiaSearchSource
    • Index type: Okapi BM25 Rank
    • ZCTextIndex Lexicon used: http://nfp-bg.eionet.eu.int/waste/catalog//catalogTextIdx/catalogLexicon
  4. The MetaData collected is:
    • PrincipiaSearchSource
    • id
    • title
  5. The Find Object is run only for Objects of Type: DTML Document
  6. The list of items is created correctly for the catalog (I have removed only the css / js dtml files)
  7. The following code is used for the Search form:
<form action="search-results" method="get">
    <input type="text" name="catalogTextIdx" id="catalogTextIdx" value="<dtml-if catalogTextIdx>
    <dtml-var catalogTextIdx><dtml-else>Search...</dtml-if>" class="search-field" />
    <input type="submit" name="SUBMIT" value="Submit Query" class="button" />
</form>

Finally the following code is used for the Search Results Page:

<dtml-with common>&dtml.-Header;&dtml.-left-column;</dtml-with>
<td id="content" valign="top">
    <h2>Search Results</h2>

    <dtml-in expr="catalog(meta_type=['DTML Document'])">
        <h3>Result founded: <a href="<dtml-var "catalog.getpath(data_record_id_)">"><dtml-var title></a></h3>
        <dtml-var "filterRenderedHTML(PrincipiaSearchSource)">
    </dtml-in>
</td>
<dtml-with common>&dtml.-right-column;&dtml.-Footer;</dtml-with>

It should be working, but it's not. I believe it should be something small, but still not sure.

Thanks in advance for all your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

少女净妖师 2024-10-08 05:14:33

ZCatalog 有一个怪癖,如果您的查询包含目录中不存在的索引,它将返回所有索引对象。在这种情况下,您的查询似乎涉及您未设置的“meta_type”索引。因此 ZCatalog 尝试应用该索引,但没有找到它,因此它返回所有项目。

The ZCatalog has a quirk which is that if your query includes an index that does not exist in the catalog, it will return all indexed objects. In this case, your query appears to involve a "meta_type" index which you did not set up. So the ZCatalog tries to apply that index, but doesn't find it, so it returns all the items.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文