openserp-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Web search with OpenSERP

使用 OpenSERP 进行网页搜索

OpenSERP returns real results pages from named engines, with original ranks, plus page content as Markdown. Use the MCP tools (
search
,
mega_search
,
any_search
,
extract
,
batch_extract
,
list_engines
). Without MCP, call the HTTP API on
http://localhost:7000
(or
$OPENSERP_BASE_URL
).
OpenSERP 会返回指定搜索引擎的真实结果页面及原始排名,并将页面内容转换为 Markdown。可以使用 MCP 工具(
search
、
mega_search
、
any_search
、
extract
、
batch_extract
、
list_engines
)。如果没有 MCP,请调用
http://localhost:7000
(或
$OPENSERP_BASE_URL
)上的 HTTP API。

Workflow

工作流程

  1. Search one engine first.
    search
    with
    engine: "google"
    for general queries. Use
    yandex
    for Russian-language,
    baidu
    for Chinese-language queries. Keep
    limit
    at 10 unless you need more.
  2. Pick sources by rank and domain. Prefer official docs, release notes and primary sources over aggregators. Skip
    type: "ad"
    .
  3. Read with one
    batch_extract
    call
    for the 2-4 URLs you need, not repeated
    extract
    calls. Avoid archive or changelog index pages: they can be hundreds of KB. Pick the single post or section page instead.
  4. Answer with links. Cite each claim with the URL you read. Mention the engine and rank when ranking matters (SEO questions).
  1. 先搜索一个搜索引擎。 对于常规查询,使用
    search
    并设置
    engine: "google"
    。俄语查询使用
    yandex
    ,中文查询使用
    baidu
    。除非需要更多结果,否则将
    limit
    保持为 10。
  2. 根据排名和域名选择来源。 优先选择官方文档、发布说明和第一手来源,而不是聚合网站。跳过
    type: "ad"
    的结果。
  3. 只调用一次
    batch_extract
    ,以读取所需的 2-4 个 URL,不要重复调用
    extract
    。避免使用存档页或变更日志索引页,因为这些页面可能达到数百 KB。应选择具体的文章页或章节页。
  4. 回答时附上链接。 每项结论都应引用已阅读页面的 URL。当排名很重要时(SEO 问题),请注明搜索引擎和排名。

When a search fails

搜索失败时

  • captcha detected
    ,
    blocked
    or
    rate_limited
    from one engine: do not retry the same engine more than once. Use
    any_search
    with
    engines: ["google", "duckduckgo", "bing"]
    , or
    search
    on another engine.
  • Results that do not match the query (unrelated brands, dictionary pages, a single keyword) mean the engine served a degraded page. Treat them as a failure and switch engine; do not use them as evidence.
  • An empty result set is not proof that nothing exists. Rephrase once or try another engine.
  • In
    batch_extract
    , an item with
    metadata.error
    failed; the others are still valid.
  • 如果某个搜索引擎返回
    captcha detected
    、
    blocked
    或
    rate_limited
    ,不要以相同搜索引擎重试超过一次。请使用
    any_search
    并设置
    engines: ["google", "duckduckgo", "bing"]
    ,或改用其他搜索引擎执行
    search
    。
  • 如果结果与查询不匹配(出现无关品牌、词典页面或仅有单个关键词),说明该搜索引擎返回了降级页面。将其视为搜索失败并切换搜索引擎;不要将这些结果作为证据。
  • 空结果集并不能证明不存在相关内容。可以重新表述一次查询,或尝试其他搜索引擎。
  • 在
    batch_extract
    中,如果某个条目出现
    metadata.error
    ,则表示该条目提取失败;其他条目仍然有效。

HTTP fallback

HTTP 回退方案

bash
curl "http://localhost:7000/google/search?text=QUERY&limit=10"
curl "http://localhost:7000/mega/search?text=QUERY&engines=google,duckduckgo&mode=any"
curl -X POST "http://localhost:7000/extract/batch" -H "Content-Type: application/json" \
  -d '{"urls":["https://example.com/a","https://example.com/b"],"mode":"auto"}'
extract=N
adds Markdown for up to N organic results (1-5) in one call. Ads and answer rows are skipped.
bash
curl "http://localhost:7000/google/search?text=QUERY&limit=10"
curl "http://localhost:7000/mega/search?text=QUERY&engines=google,duckduckgo&mode=any"
curl -X POST "http://localhost:7000/extract/batch" -H "Content-Type: application/json" \
  -d '{"urls":["https://example.com/a","https://example.com/b"],"mode":"auto"}'
extract=N
会在一次调用中为最多 N 个自然搜索结果(1-5 个)添加 Markdown。广告和答案栏会被跳过。