-
Notifications
You must be signed in to change notification settings - Fork 32
Synonyms as code #2088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Synonyms as code #2088
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9e478f4
Introduce synonyms.yaml to standardize declarations. Apply synonyms v…
cotti b8fbd6d
Touch up
cotti 453dc9e
Merge branch 'main' into feature/synonyms_as_code
cotti 9bb389d
Add synonyms to project resources.
cotti ab55d38
Adjust to parse yaml lists
cotti abb1c59
Merge branch 'main' into feature/synonyms_as_code
cotti 6cbce2b
Add preliminary docs
cotti 64d6e82
Merge branch 'main' into feature/synonyms_as_code
cotti a3c0bc8
Fix link
cotti 5202f05
Fix linting
cotti 442d00d
Lint
cotti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| synonyms: | ||
| - ".net,.NET,c#,csharp,dotnet,net,NET,DOTNET" | ||
| - "esql,es|ql" | ||
| - "motlp,managed otlp,Managed OTLP" | ||
| - "s3,aws s3,amazon s3" | ||
| - "es,elasticsearch" | ||
| - "Elastic Learned Sparse EncodeR,elser" | ||
| - "ccs,cross cluster search,cross-cluster search,spaghetti" | ||
| - "apm,application performance monitoring" | ||
| - "ecctl,Elastic Cloud Control" | ||
| - "opentelemetry,otel" | ||
| - "eck,Elastic Cloud on Kubernetes" | ||
| - "ece,Elastic Cloud Enterprise" | ||
| - "ELv2,Elastic License v2" | ||
| - "kql,Kibana Query Language" | ||
| - "ccr,cross-cluster replication,cross cluster replication" | ||
| - "ESaaS,Elastic Stack as a service" | ||
| - "knn,k-Nearest Neighbors" | ||
| - "ech,Elastic Cloud Hosted,ess" | ||
| - "aws,amazon" | ||
| - "ilm,index lifecycle management" | ||
| - "javascript,js,node,nodejs,node.js" | ||
| - "edot,elastic distribution of opentelemetry" | ||
| - "k8s,kubernetes" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/Elastic.Documentation.Configuration/Synonyms/SynonymsConfiguration.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // Licensed to Elasticsearch B.V under one or more agreements. | ||
| // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. | ||
| // See the LICENSE file in the project root for more information | ||
|
|
||
| namespace Elastic.Documentation.Configuration.Synonyms; | ||
|
|
||
| public record SynonymsConfiguration | ||
| { | ||
| public required IReadOnlyCollection<string> Synonyms { get; init; } | ||
| } | ||
|
|
||
| internal sealed record SynonymsConfigDto | ||
| { | ||
| public List<string> Synonyms { get; set; } = []; | ||
| } | ||
|
|
||
| public static class SynonymsConfigurationExtensions | ||
| { | ||
| public static SynonymsConfiguration CreateSynonymsConfiguration(this ConfigurationFileProvider provider) | ||
| { | ||
| var synonymsFile = provider.SynonymsFile; | ||
| var synonymsDto = ConfigurationFileProvider.Deserializer.Deserialize<SynonymsConfigDto>(synonymsFile.OpenText()); | ||
| return new SynonymsConfiguration { Synonyms = synonymsDto.Synonyms }; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit torn on this.
I understand that it was easier to use
,as a delimiter instead of having a 2d list here.I'm a bit worried that this will be prone to undetected errors.
What are your thoughts on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... If it has a parsing error, it would be loud.
But in general, I don't have a strong feeling one way or the other. I imagined this file won't be manipulated nearly as much outside from people involved in looking at the dashboards.
It would be better for this branch's CI to create a quick PR with just the file, so maybe I could update it already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM. your call
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using commas currently also mimics how synonyms are stored historically in synonym text files. I kinda like it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sees comment just after changing it