Sphinx在哪里搜索REST API [英] Where is Sphinx search REST API documented

查看:146
本文介绍了Sphinx在哪里搜索REST API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由Sphinx生成并托管在Web上的文档包括搜索界面。

Documentation generated by Sphinx and hosted on Web, includes search interface.

例如,在搜索官方Python文档的术语popen时,此URL被构造:

For example, when searching official Python documentation for term "popen", this url is constructed:

https://docs.python.org/3/search.html?q=popen&check_keywords=yes&area=default

在哪里可以找到有关可能搜索参数的更多信息?

Where can I found more info about possible search parameters?

推荐答案

默认情况下,Sphinx(文档工具)不提供REST用于搜索的API。

By default, Sphinx (the documentation tool) does not provide a REST API for search.

搜索执行完全基于JavaScript。

The search execution is completely JavaScript-based.


  • 当您构建Sphinx项目时,将创建一个包含搜索索引的JavaScript文件( searchindex.js )。

当您执行搜索查询时,搜索前端将标识所有被视为命中和ge的文件他们的源文件从服务器。这些是仅需要静态文件服务器的简单文件 GET 请求。

When you execute a search query, the search front end will identify all files that are considered a hit and get their source files from the server. These are simple file GET requests that only require a static file server. Snippets of these files that contain the fitting character sequence will be displayed.

令人惊讶的是,搜索算法( searchtools.js _static 目录中的html构建中)只考虑第一个( q )查询参数。所有其他参数将被忽略。

Surprisingly, the search algorithm (searchtools.js in the html build in the _static directory) only considers the first (the q) query parameter. All other parameters are ignored.

这篇关于Sphinx在哪里搜索REST API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆