Skip to content

Add intervals query tutorial with runnable examples and advanced use cases - #5585

Open
leemthompo with Copilot wants to merge 10 commits into
mainfrom
copilot/improve-intervals-query-page
Open

leemthompo with Copilot wants to merge 10 commits into
mainfrom
copilot/improve-intervals-query-page

Conversation

Copilot AI commented Mar 23, 2026 •

Copy link
Copy Markdown
Contributor

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

  • New tutorial: solutions/search/full-text/intervals-query-tutorial.md uses 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:
    1. Ordered proximity search with all_of and max_gaps
    2. Alternative terms with any_of
    3. Term variants with prefix, including the expansion limit warning
    4. Excluding terms with a not_containing filter
  • Navigation: adds the tutorial to solutions/toc.yml and links it from solutions/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 prefix example that didn't actually need prefix.

🤖 Generated with Claude Code

…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 AI changed the title [WIP] Enhance intervals query page based on user feedback Add intervals query tutorial with runnable examples and advanced use case Mar 23, 2026
Copilot AI requested a review from leemthompo March 23, 2026 09:44
@leemthompo

Copy link
Copy Markdown
Member

@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.

Copilot AI changed the title Add intervals query tutorial with runnable examples and advanced use case Add intervals query tutorial with runnable examples and advanced use cases Mar 23, 2026
@github-actions

github-actions Bot commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ 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.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Elastic Docs AI PR menu

Check the box to run an AI review for this pull request.

  • Review docs changes (docs-review). Status: not started.

Powered by GitHub Agentic Workflows and docs-actions. For more information, reach out to the docs team.

@github-actions

github-actions Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

- 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>
@leemthompo
leemthompo requested a review from romseygeek October 26, 2026 16:30

@romseygeek romseygeek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small comments but LGTM otherwise

}
```

1. The `prefix` rule matches any indexed term that starts with `fast`, such as `fast`, `faster`, and `fastest`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swapped it for a partial-word example (search relev), which stemming can't handle.

]
}
}
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth pointing out the scores here that reduce as the terms are more distance from each other

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

This branch was successfully deployed

1 active deployment
docs-preview — 803623d7 Deployed Oct 26, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants