总是通过ZCatalog得到相同的结果?一切都是照本宣科!

2024-05-19 12:52:28 发布

您现在位置:Python中文网/ 问答频道 /正文

这很奇怪,但我不能让ZCatalog工作。一切都是照本宣科的,结果总是一样的。你知道吗

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

到目前为止我所做的:

  1. 已创建ZCatalog对象
  2. 已创建包含以下项的ZCTextIndex词典
    • HTMLWordSplitter文件
    • 干酪规格化器
    • 停止字删除器
    你知道吗
  3. 已创建catalogTextIdx索引-参数为:
    • 索引属性的名称:PrincipiaSearchSource
    • 索引类型:Okapi BM25 Rank
    • 使用的ZCTextIndex词典:http://nfp-bg.eionet.eu.int/waste/catalog//catalogTextIdx/catalogLexicon你知道吗
    你知道吗
  4. 收集的元数据是:
    • PrincipiaSearchSource公司
    • 身份证
    • 职务
    你知道吗
  5. Find对象仅对DTML Document类型的对象运行
  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>

它应该有用,但不是。我相信应该是一些小东西,但还是不确定。你知道吗

谢谢你的帮助。你知道吗


Tags: 对象idhttpsearchvartypewithbg
1条回答
网友
1楼 · 发布于 2024-05-19 12:52:28

ZCatalog有一个怪癖,即如果查询包含目录中不存在的索引,它将返回所有索引对象。在本例中,您的查询似乎涉及一个您没有设置的“meta\ type”索引。因此ZCatalog尝试应用该索引,但没有找到它,因此它返回所有项。你知道吗

相关问题 更多 >