为什么标题中的全文搜索返回错误

问题描述 投票:5回答:2

当我使用Wikipedia API执行全文搜索时,不能将其范围缩小到仅标题(srwhat = title)。

因此在任何地方搜索(默认)http://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=sql&srnamespace=14&format=xml

返回结果,如果我添加srwhat = title,则出现错误:

<api servedby="mw69">
  <error code="srsearch-title-disabled" info="title search is disabled"/>
</api>

此错误甚至在文档(http://www.mediawiki.org/wiki/API:Search)中列出,但没有任何解释。

full-text-search wikipedia-api mediawiki-api
2个回答
3
投票

这意味着Wikipedia使用的搜索引擎(我相信Lucene不支持标题搜索。


3
投票

实际上,有一种解决方法,只需在搜索词中添加intitle:前缀:

srsearch=intitle:sql

您可以在此处找到说明:https://en.wikipedia.org/wiki/Help:Searching#Parameters

© www.soinside.com 2019 - 2024. All rights reserved.