Search: Add ai_autocomplete_questions field for autocomplete#3107
Search: Add ai_autocomplete_questions field for autocomplete#3107
Conversation
The current prompt generates overly complex questions that don't match real user search behavior. Redesign the prompt to produce shorter, simpler questions (3-10 words) suitable for autocomplete and semantic search — e.g. "What is agent builder?" instead of "How do I import external tools using Model Context Protocol?" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded a new AI enrichment field Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/Elastic.Documentation/Search/DocumentationDocument.cs`:
- Around line 150-151: The AiField attribute's prompt string on
DocumentationDocument is self-contradictory: it tells users to "Avoid jargon,
specific API names" but then includes the example "What is the bulk API?";
update the prompt in the AiField attribute to be consistent by either removing
the rule about avoiding specific API names or replacing the example with a
non-API-specific example (e.g., "What is bulk indexing?") so the guidance and
examples match; locate the AiField attribute text on the property in
DocumentationDocument and make the prompt and examples consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 92e1a1a3-4c37-4787-9226-32bf2338991b
📒 Files selected for processing (1)
src/Elastic.Documentation/Search/DocumentationDocument.cs
The prompt said "Avoid specific API names" but then used "What is the bulk API?" as an example. Remove the API name restriction since we want questions to reference feature/product names naturally. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mpdreamz
left a comment
There was a problem hiding this comment.
Should we have both? I feel the current will become super useful when we do more data/ai generated curation in the future.
Restore the original ai_questions prompt and add a new ai_autocomplete_questions field with a prompt targeting short, simple questions (3-10 words) suitable for search bar autocomplete. Includes lexical mapping with SearchAsYouType completion multi-field and semantic text mapping. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add suggest completion multi-field to both ai_questions and ai_autocomplete_questions, matching the approach in #3108. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Keep the suggest completion field only on ai_autocomplete_questions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
What
Add a new
ai_autocomplete_questionsAI enrichment field with a prompt targeting short, simple questions for search bar autocomplete. Keep the existingai_questionsfield unchanged.Why
The existing
ai_questionsgenerates detailed technical questions (6-15 words) useful for semantic search, but too complex for autocomplete suggestions. Users searching naturally type simpler queries like "What is agent builder?" rather than "How do I import external tools using Model Context Protocol?"How
AiAutocompleteQuestionsproperty toDocumentationDocumentwith a prompt targeting 3-10 word questionsSearchAsYouTypecompletion andCompletionsuggest multi-fieldssuggestcompletion multi-field to existingai_questionsmapping (per Search: Add completion suggest field to ai_questions mapping #3108)Test plan
🤖 Generated with Claude Code