Search: Add completion suggest field to ai_questions mapping#3108
Search: Add completion suggest field to ai_questions mapping#3108
Conversation
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)
📝 WalkthroughWalkthroughThe changes modify the Elasticsearch mapping configuration for the 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 |
Mpdreamz
left a comment
There was a problem hiding this comment.
The search as you type is great if we have single autocomplete with mixed results and scoring. I believe we will bucket the results so question suggestions and doc suggestions are isolated from eachother. FST is great for that.
However other things become harder too, synonyms, partial (mid sentence words) starts, and scoring (weighting).
Approving we can play with this but I suspect we'd end up doing a search on the search_as_you type field instead.
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>
|
Will be handled in #3107 |
* Search: Simplify ai_questions prompt for search-friendly output 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> * Search: Fix contradictory guidance in ai_questions prompt 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> * Search: Add ai_autocomplete_questions field with simplified prompt 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> * Search: Add completion suggest multi-field to ai_questions mappings 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> * Search: Remove suggest multi-field from ai_questions mapping Keep the suggest completion field only on ai_autocomplete_questions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
What
Add an FST-based
completiontype multi-field (ai_questions.suggest) to the ai_questions mapping for use with the completion suggester API.Why
The existing
ai_questions.completionmulti-field issearch_as_you_type(inverted index with shingles), which is incompatible with the completion suggester API. The completion suggester requires a field of typecompletion(FST).How
Added a new
suggestmulti-field withCompletion()type alongside the existingcompletionSearchAsYouType multi-field.Test plan
Notes
Named
suggestsince thecompletionmulti-field name is already taken by SearchAsYouType.🤖 Generated with Claude Code