Repository navigation
Add intervals query tutorial with runnable examples and advanced use cases - #5585
leemthompo with Copilot wants to merge 10 commits into
Conversation
…ix use case Co-authored-by: leemthompo <32779855+leemthompo@users.noreply.github.com> Agent-Logs-Url: https://github.com/elastic/docs-content/sessions/bc2dc533-b754-466a-b219-02e150b9c84b
|
@copilot this needs some polish and the cognitive boost of a stronger model like Opus 4.6 Please read, critique, and update the changes accordingly based on a thorough review |
…curacy, add filter example Major improvements: - Restructure to follow Elastic tutorial content type template (frontmatter with description/navigation_title, "Before you begin", numbered steps, summary section) - Replace thin sample data with richer book synopses that better demonstrate each feature - Fix factual error in any_of example (doc 5 matches too, gap=2) - Add max_gaps: 0 to outer all_of in basic example to actually enforce adjacency (was misleading before) - Add Step 5: filter example with not_containing (demonstrates an additional advanced use case from the reference page) - Fix prefix example: sample data now includes both "fast" and "faster" to meaningfully demonstrate prefix expansion - Revert querydsl.md (sub-bullet was inconsistent with page structure) - Simplify full-text.md change to a single bullet under existing section Co-authored-by: leemthompo <32779855+leemthompo@users.noreply.github.com> Agent-Logs-Url: https://github.com/elastic/docs-content/sessions/8101e7ca-119f-4e37-a334-76fe7a08b9dd
This comment was marked as outdated.
This comment was marked as outdated.
✅ Elastic Docs Style Checker (Vale)No issues found on modified lines! The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
Elastic Docs AI PR menuCheck the box to run an AI review for this pull request.
Powered by GitHub Agentic Workflows and docs-actions. For more information, reach out to the docs team. |
🔍 Preview links for changed docs |
- Correct step 3 hit order and scores to match actual responses - Rewrite step 4 so the prefix rule matches only through a term variant - Clarify the prefix expansion warning and move it after the example - Remove em-dashes from tutorial prose and the full-text.md link Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Expand Before you begin with access, privileges, and assumed knowledge - Add audience statement, Step 1 checkpoint, and type: tutorial - Fix match_phrase wording to account for slop - Style fixes: active voice, contractions, heading parallelism, split long sentence Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
romseygeek
left a comment
There was a problem hiding this comment.
Two small comments but LGTM otherwise
| } | ||
| ``` | ||
|
|
||
| 1. The `prefix` rule matches any indexed term that starts with `fast`, such as `fast`, `faster`, and `fastest`. |
There was a problem hiding this comment.
This is the sort of thing that is often handled by stemming or lemmatization, so it might be better to choose a different example to avoid confusion.
There was a problem hiding this comment.
Swapped it for a partial-word example (search relev), which stemming can't handle.
| ] | ||
| } | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Maybe worth pointing out the scores here that reduce as the terms are more distance from each other
There was a problem hiding this comment.
Added a short note explaining how scores drop as terms get farther apart.
- Replace the fast/faster prefix example, which stemming already handles, with a partial-word example - Explain how scores drop as matching terms get farther apart Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Relates to #3828, which collected user feedback on the intervals query reference page: no runnable examples, no sample responses, and no advanced use case.
Companion PR: elastic/elasticsearch#163403 links the reference page to this tutorial and closes the issue. Merge this PR first.
Changes
solutions/search/full-text/intervals-query-tutorial.mduses sample book data so every example runs as-is in Console. It builds up one rule at a time, and each step has an example response:all_ofandmax_gapsany_ofprefix, including the expansion limit warningnot_containingfiltersolutions/toc.ymland links it fromsolutions/search/full-text.md.All requests and responses were run end to end against Elasticsearch 9.6.
How this was written
Copilot wrote the first draft. Claude Opus 5.5 then rechecked and rewrote it: it reran every example against a live cluster, fixed incorrect example responses, and replaced a
prefixexample that didn't actually needprefix.🤖 Generated with Claude Code