Skip to content

Configure synonyms in Elasticsearch: post-review improvements - #7945

Open
leemthompo wants to merge 33 commits into
mainfrom
docs/synonyms-review-improvements
Open

Configure synonyms in Elasticsearch: post-review improvements#7945
leemthompo wants to merge 33 commits into
mainfrom
docs/synonyms-review-improvements

Conversation

@leemthompo

@leemthompo leemthompo commented Aug 13, 2026

Copy link
Copy Markdown
Member

solutions/search/full-text/search-with-synonyms.md

Summary

Addresses elastic/docs-content-internal#1624 — post-calibration review improvements to the Search with synonyms page.

Changes

Title and page opening

  • Rename H1 to "Configure synonyms in Elasticsearch" with navigation_title: Synonyms
  • Add navigation_title: Synonym set API examples to the child page
  • Rewrite intro into two cohesive paragraphs that frame synonym use cases as deliberate actions (not automatic improvements)
  • Add frontmatter description for SEO

Structure and flow

  • Add prerequisites section (manage_search_synonyms cluster privilege)
  • Rewrite overview as a 5-step workflow with jump links ("Synonyms workflow overview")
  • Convert four synonym set method headings into a tab-set (REST API first, then Kibana UI, File-based, Inline)
  • Trim synonym rule formats to a two-bullet primer with link to reference
  • Add Step 5: "Search with synonyms" with a working match query example
  • Add "Next steps" section with links to API examples, token filter references, and text analysis overview

Technical accuracy

  • Rewrite Step 3 example to use synonym_graph + synonyms_set (consistent with recommendation)
  • Rename analyzer from my_analyzer to synonyms_analyzer throughout
  • Rewrite test example (Step 4) to use the named synonyms_analyzer on my-index instead of a throwaway inline filter chain
  • Fix circuit breaker description: lenient defaults to updateable value, trimmed to one sentence with reference link
  • Add query-type reference links (match, query_string, simple_query_string) in Step 5
  • Surface search-time-only constraint for API/UI synonym sets in Step 1 (as prose, not admonition)

Applicability

  • Fix Kibana UI applies_to: stack: ga 9.1 + serverless: elasticsearch: (was serverless-only)
  • File-based tab: serverless: unavailable
  • Inline tab: warning recommending REST API or file-based approach (plain text, no anchor links to tab content)

Language and style

  • Use "equivalent mappings" terminology consistently (not "equivalent synonyms")
  • Standardize "synonyms sets" → "synonym sets" throughout
  • Fix future tense → present tense
  • Fix heading hierarchy (H2→H4 skip), code block language tags (markdowntext)
  • Unstick stacked admonitions in Step 2: circuit breaker as inline prose, invalid rules as important admonition
  • Add stop token filter ordering note in Step 2
  • Move nonexistent synonym set warning outside the tab-set to end of Step 1
  • Use code annotations (<1>, <2>, <3>) instead of redundant tabbed examples in Step 3

Companion PR

Follow-up

  • The $$$ anchor stubs (lines 20–25) are migration artifacts kept to prevent broken cross-repo references. Clean up separately once those references are resolved.

Code verification

All code examples tested end-to-end against a local ES deployment:

  • Synonym set creation via API ✅
  • Index creation with synonym_graph + synonyms_set analyzer ✅
  • Analyze API (GET /my-index/_analyze with named synonyms_analyzer) ✅
  • Match query with synonym expansion ✅

- Standardize 'synonyms sets' to 'synonym sets' and 'synonyms set'
  to 'synonym set' throughout (matching the API spec convention)
- Fix future tense to present tense: 'will be replaced' to 'are
  replaced', 'will automatically reload' to 'automatically reload',
  'will remain' to 'remains'
- Add missing terminal periods
- Fix self-referencing full-relative-path link to a simple anchor
- Add forward-link from Method 1 to Method 3 (file-based approach)
- Fix heading levels: H4 to H3 for 'Explicit mappings' and
  'Equivalent mappings' (were skipping H3 under H2)
- Remove hardcoded count from section intro
- Rewrite overview to list 4 steps with jump links matching the body
- Add prerequisites section with manage_search_synonyms privilege
- Remove section-level applies_to from Method 1 (Kibana UI) that
  wrongly restricted it to serverless only; the page-level tag
  already covers both stack and serverless
- Add serverless: unavailable inline tag to the index-time bullet
  in Step 4 (serverless only supports search-time synonyms)
- Add synonym_graph search-only constraint: note that synonym_graph
  is for search analyzers only and synonym filter is required for
  index-time use
- Fix circuit breaker accuracy: lenient defaults to the value of
  updateable, so the default behavior with updateable: true is to
  log and use an empty map, not to red-state the index
- Convert circuit breaker note from admonition to inline prose with
  plain-language gloss, eliminating the stacked note+warning pattern
- Trim invalid rules warning to essential sentence with reference
  link
- Remove forward-referencing sentence about equivalent synonyms
- Simplify expand parameter detail to two-bullet summary with link
  to synonym graph token filter reference
- Trim 30-line commented synonyms file example to short 8-line
  sample; link to reference for full format specification
- Change code block language tag from markdown to text (Solr format
  where # is a comment, not a heading)
- Surface search-time-only constraint in Step 1 as a note
- Add link to synonyms API in Method 2
- Switch filter type from synonym to synonym_graph (consistent with
  the recommendation in Step 2)
- Switch primary example from synonyms_path to synonyms_set so it
  works for API/UI users (the majority path)
- Add file-based variant in a tab with serverless: unavailable tag
- Add tokenizer: standard and lowercase filter for a realistic
  analyzer chain
- Use console code blocks with PUT verb
- Add query-time reference links for match, query_string, and
  simple_query_string queries with auto_generate_synonyms_phrase_query
- Add 'Search with synonyms in action' section with a match query
  example that demonstrates synonym expansion end-to-end
- Add 'Next steps' section linking to API examples, token filter
  references, and text analysis overview
- Use backtick code formatting for search terms instead of
  quotation marks to avoid punctuation placement issues
- Simplify 'A large number of' to 'Too many'
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Elastic Docs Style Checker (Vale)

Summary: 2 warnings, 1 suggestion found

⚠️ Warnings (2): Fix when the suggestion improves clarity or correctness.
File Line Rule Message
solutions/search/full-text/search-with-synonyms.md 45 Elastic.MenuArrows Use '→' to separate menu items, not '' or '='. Example: Select Manage index → Add lifecycle policy.
solutions/search/full-text/search-with-synonyms.md 45 Elastic.MenuArrows Use '→' to separate menu items, not '' or '='. Example: Select Manage index → Add lifecycle policy.
💡 Suggestions (1): Optional style improvements. Apply when helpful.
File Line Rule Message
solutions/search/full-text/search-with-synonyms.md 229 Elastic.WordChoice Consider using 'efficient, basic' instead of 'simple', unless the term is in the UI.

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

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.

- Rename H1 to 'Set up and search with synonyms in ES'
- Replace bullet-list intro with two cohesive paragraphs:
  define synonyms, explain the value, frame the page scope
- Move ECE custom-bundle note out of the opening (anchors
  kept as migration artifacts to avoid broken builds)
- Use product substitution variables in headings
Replace 'equivalent synonyms' with 'equivalent mappings'
throughout, matching the section heading and standard
Elasticsearch terminology.
Collapse two near-identical tab panels into one example
with a code annotation callout for the file-based variant.
Add prose before the example calling out the synonyms_path
alternative.
Replace four Method headings with a tab-set for cleaner
navigation. Preserve BWC anchors using $$$ syntax for
cross-repo links from elasticsearch reference pages.
Collapse detailed format examples and expand behavior into
a two-bullet summary with a link to the synonym graph token
filter reference for full details including WordNet format.
Replace verbose inline circuit breaker explanation with a
brief mention and linked reference to the synonym graph
token filter page.
Reorder so the index mapping (now Step 3) exists before
testing the analyzer (now Step 4). Rewrite the test example
to use the named my_analyzer on my-index instead of a
throwaway inline filter chain. All examples verified
end-to-end against a local ES cluster.
Add BWC anchor to Kibana UI tab and update the inbound
link from elasticsearch-solution-project.md.
Mention that stop filter placement relative to synonym
filters affects expansion, with a link to the reference
section for details.
Scope to stack: ga 9.1 and serverless: ga instead of
removing the tag entirely.
Use serverless: elasticsearch project type instead of bare
serverless: ga. The synonyms UI is only available on
serverless Elasticsearch (search) projects.
Add a code snippet showing the synonyms parameter, and
link the warning to the API and file-based alternatives.
The warning about creating sets before referencing them
belongs in Step 1 where sets are created, not Step 2.
Drop unexplained concept names from the link-out sentence.
Place it after the closing tab-set delimiter so it renders
as a standalone warning at the end of Step 1.
The reference page already has proper version scoping on
its circuit breaker section. No need to duplicate it on
a brief pointer.
Rename heading and add jump link in the workflow overview
so the search example is part of the continuous thread.
Rewrite Step 3 heading and trim to focus on creating the
index. Move supported query types to Step 5 where the
reader actually runs a search. Remove duplicated note
about API/UI search-time constraint (already in Step 1).
- Rename H1 to 'Configure synonyms in ES'
- Add navigation_title: Synonyms to frontmatter
- Rename my_analyzer to synonyms_analyzer throughout
- Move REST API tab first (recommended approach)
- Add code annotations for search_analyzer and updateable
- Consolidate file-based callout into annotation only
- Convert search-time-only note to plain prose
- Simplify synonym format reference link
Frame synonym benefits as things you can do by defining
rules, not as automatic outcomes of enabling synonyms.
@leemthompo leemthompo changed the title Search with synonyms: post-review improvements Configure synonyms in Elasticsearch: post-review improvements Aug 14, 2026
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.

1 participant