{"record":{"id":"acb1b2a1398f9195","repo":"jackwener/OpenCLI","slug":"no-papers-found-try-a-different-keyword","errorCode":null,"errorMessage":"No papers found. Try a different keyword.","messagePattern":"No papers found\\. Try a different keyword\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/arxiv/search.js","lineNumber":26,"sourceCode":"    description: 'Search arXiv papers',\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'query', positional: true, required: true, help: 'Search keyword (e.g. \"attention is all you need\")' },\n        { name: 'limit', type: 'int', default: 10, help: 'Max results (max 25)' },\n    ],\n    columns: ['id', 'title', 'authors', 'published', 'primary_category', 'url'],\n    func: async (args) => {\n        const queryText = String(args.query || '').trim();\n        if (!queryText) {\n            throw new ArgumentError('arxiv search query cannot be empty');\n        }\n        const limit = normalizeArxivLimit(args.limit, 10, 25);\n        const query = encodeURIComponent(`all:${queryText}`);\n        const xml = await arxivFetch(`search_query=${query}&max_results=${limit}&sortBy=relevance`);\n        const entries = parseEntries(xml);\n        if (!entries.length)\n            throw new EmptyResultError('arxiv', 'No papers found. Try a different keyword.');\n        return entries.map(e => ({\n            id: e.id,\n            title: e.title,\n            authors: e.authors,\n            published: e.published,\n            primary_category: e.primary_category,\n            url: e.url,\n        }));\n    },\n});\n","sourceCodeStart":8,"sourceCodeEnd":37,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/arxiv/search.js#L8-L37","documentation":"An EmptyResultError thrown when the arXiv relevance-sorted search (all:<query>) parses to zero entries, meaning no papers matched the keywords. arXiv returns an empty feed rather than an error for non-matching queries, so the library surfaces this as an expected empty result with a hint to try different keywords.","triggerScenarios":"`opencli arxiv search \"<terms>\"` where the all: field query matches nothing — overly specific multi-word phrases, obscure terminology, or searching for non-paper content.","commonSituations":"Searching full sentences instead of keywords; jargon not used in arXiv metadata; searching for author names (better served by `arxiv author`); limiting fields the all: index does not cover well.","solutions":["Shorten the query to 1-3 core keywords and re-run","Try synonyms or standard arXiv terminology","Use `opencli arxiv author \"<name>\"` instead if searching by author","Check spelling and avoid special characters/punctuation in the query"],"exampleFix":"// before\nawait exec('opencli arxiv search \"a very long natural language question about transformers\"');\n// after\nconst keywords = query.split(/\\s+/).slice(0, 3).join(' ');\nawait exec(`opencli arxiv search \"${keywords}\"`); // \"transformers attention\"","handlingStrategy":"fallback","validationCode":"const query = String(userQuery || '').trim();\nif (!query) throw new Error('search query required');","typeGuard":"null","tryCatchPattern":"try {\n  return await exec(`opencli arxiv search \"${query}\"`);\n} catch (e) {\n  if (e.name === 'EmptyResultError') {\n    const shortened = query.split(/\\s+/).slice(0, 2).join(' ');\n    if (shortened && shortened !== query) {\n      return await exec(`opencli arxiv search \"${shortened}\"`); // retry with fewer keywords\n    }\n    return [];\n  }\n  throw e;\n}","preventionTips":["Prefer 1-3 keywords over full sentences","Use standard arXiv terminology/synonyms","Route author-name lookups to `arxiv author` instead","Treat EmptyResultError as an expected empty outcome and degrade gracefully"],"tags":["empty-result","arxiv","search"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}