Skip to content

Commit

Permalink
Fix Documentation for various languages in Discover (opensearch-proje…
Browse files Browse the repository at this point in the history
…ct#8636)

* Fix Documentation for various languages in Discover

Signed-off-by: Suchit Sahoo <[email protected]>

* Update Snapshots

Signed-off-by: Suchit Sahoo <[email protected]>

* Update the Lucene Language Reference

Signed-off-by: Suchit Sahoo <[email protected]>

---------

Signed-off-by: Suchit Sahoo <[email protected]>
  • Loading branch information
LDrago27 authored Oct 18, 2024
1 parent 84f925b commit e5b7067
Show file tree
Hide file tree
Showing 46 changed files with 413 additions and 3,448 deletions.
21 changes: 21 additions & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,18 @@ export class DocLinksService {
// https://opensearch.org/docs/latest/api-reference/snapshots/verify-snapshot-repository/
veirfyRepository: `${OPENSEARCH_WEBSITE_DOCS}/api-reference/snapshots/verify-snapshot-repository/`,
},
lucene: {
// https://opensearch.org/docs/latest/query-dsl/full-text/query-string/
base: `${OPENSEARCH_WEBSITE_DOCS}/query-dsl/full-text/query-string/`,
},
ppl: {
// https://opensearch.org/docs/latest/search-plugins/sql/ppl/syntax/
base: `${OPENSEARCH_WEBSITE_DOCS}/search-plugins/sql/ppl/syntax/`,
},
sql: {
// https://opensearch.org/docs/latest/search-plugins/sql/sql/basic/
base: `${OPENSEARCH_WEBSITE_DOCS}/search-plugins/sql/sql/basic/`,
},
},
},
});
Expand Down Expand Up @@ -962,6 +974,15 @@ export interface DocLinksStart {
readonly cleanup: string;
readonly veirfyRepository: string;
};
readonly lucene: {
readonly base: string;
};
readonly sql: {
readonly base: string;
};
readonly ppl: {
readonly base: string;
};
};
};
}

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ export {
QueryStateChange,
QueryStart,
PersistedLog,
LanguageReference,
} from './query';

export { AggsStart } from './search/aggs';
Expand Down
1 change: 1 addition & 0 deletions src/plugins/data/public/query/query_string/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ export {
QueryControls,
QueryResult,
QueryStatus,
LanguageReference,
} from './language_service';
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@

export * from './types';
export { LanguageServiceContract, LanguageService } from './language_service';
export { RecentQueriesTable, QueryControls, QueryResult, QueryStatus } from './lib';
export {
RecentQueriesTable,
QueryControls,
QueryResult,
QueryStatus,
LanguageReference,
} from './lib';
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import {
UiEnhancements,
} from '../../../ui';
import { DataStorage, setOverrides as setFieldOverrides } from '../../../../common';
import { createDefaultLanguageReference } from './lib/default_language_reference';
import { dqlLanguageReference } from './lib/dql_language_reference';
import { luceneLanguageReference } from './lib/lucene_language_reference';

export class LanguageService {
private languages: Map<string, LanguageConfig> = new Map();
Expand All @@ -35,22 +36,22 @@ export class LanguageService {
}
};

public createDefaultLanguageReference = () => {
return createDefaultLanguageReference();
};

/**
* Registers default handlers for index patterns and indices.
*/
private registerDefaultLanguages() {
const defaultEditor = createEditor(
SingleLineInput,
SingleLineInput,
[this.createDefaultLanguageReference()],
DQLBody
this.registerLanguage(
getDQLLanguageConfig(
this.defaultSearchInterceptor,
createEditor(SingleLineInput, SingleLineInput, [dqlLanguageReference()], DQLBody)
)
);
this.registerLanguage(
getLuceneLanguageConfig(
this.defaultSearchInterceptor,
createEditor(SingleLineInput, SingleLineInput, [luceneLanguageReference()], DQLBody)
)
);
this.registerLanguage(getDQLLanguageConfig(this.defaultSearchInterceptor, defaultEditor));
this.registerLanguage(getLuceneLanguageConfig(this.defaultSearchInterceptor, defaultEditor));
}

public registerLanguage(config: LanguageConfig): void {
Expand Down

This file was deleted.

Loading

0 comments on commit e5b7067

Please sign in to comment.