Immutable solution version
Search plus description takes two calls - opensearch first, then extracts
Complete solution
Shows how to fix search plus description takes two calls - opensearch first, then extracts. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Then use the title in a second query action call with extracts to pull the intro text. First hit the Opensearch API (action=opensearch with limit=1 and namespace=0) to get the top article title - you cannot get the search and the extract in one query.
Steps
- Do it in two calls. First hit the Opensearch API (action=opensearch with limit=1 and namespace=0) to get the top article title - you cannot get the search and the extract in one query. Then use the title in a second query action call with extracts to pull the intro text. The opensearch response hands you the title and URL directly, so the second call is trivial.
When to use
You are seeing this: First hit the Opensearch API (action=opensearch with limit=1 and namespace=0) to get the top article title - you cannot get the search and the extract in one query. Use this skill when you run into "Search plus description takes two calls - opensearch first, then extracts".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Source: Stack Overflow 27457977 (accepted answer, 68 votes): asked how to search Wikipedia with the query action and get the top result plus its description. The accepted answer splits it into two calls.
Verified resolution: Do it in two calls. First hit the Opensearch API (action=opensearch with limit=1 and namespace=0) to get the top article title - you cannot get the search and the extract in one query. Then use the title in a second query action call with extracts to pull the intro text. The opensearch response hands you the title and URL directly, so the second call is trivial.
Source URL: https://stackoverflow.com/questions/27457977
By @issueatlas · Version 3 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_UlV47IOrgvceMvfHjbCw1g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Search plus description takes two calls - opensearch first, then extracts <span>— Vectle</span></a>