Skip to content

Commit

Permalink
discover only changes for poc
Browse files Browse the repository at this point in the history
Signed-off-by: Arpit Bandejiya <[email protected]>
  • Loading branch information
Arpit-Bandejiya committed Oct 20, 2022
1 parent fb39f7d commit cd0b92f
Show file tree
Hide file tree
Showing 22 changed files with 458 additions and 83 deletions.
8 changes: 4 additions & 4 deletions config/opensearch_dashboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@

# Set the value of this setting to true to enables the experimental multiple data source
# support feature. Use with caution.
#data_source.enabled: false
data_source.enabled: true
# Set the value of these settings to custermize crypto materials to encryption saved credentials
# in data sources.
#data_source.encryption.wrappingKeyName: 'changeme'
#data_source.encryption.wrappingKeyNamespace: 'changeme'
#data_source.encryption.wrappingKey: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
data_source.encryption.wrappingKeyName: 'changeme'
data_source.encryption.wrappingKeyNamespace: 'changeme'
data_source.encryption.wrappingKey: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
"angular-elastic": "^2.5.1",
"angular-sanitize": "^1.8.0",
"bluebird": "3.5.5",
"caniuse-lite": "^1.0.30001397",
"chalk": "^4.1.0",
"chokidar": "^3.4.2",
"color": "1.0.3",
Expand Down Expand Up @@ -212,6 +213,7 @@
"type-detect": "^4.0.8",
"uuid": "3.3.2",
"whatwg-fetch": "^3.0.0",
"yarn": "^1.22.19",
"yauzl": "^2.10.0"
},
"devDependencies": {
Expand Down Expand Up @@ -461,4 +463,4 @@
"node": "14.20.0",
"yarn": "^1.21.1"
}
}
}
1 change: 1 addition & 0 deletions src/core/server/opensearch/legacy/cluster_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const callAPI = async (
) => {
const clientPath = endpoint.split('.');
const api: any = get(client, clientPath);
console.log("This is the low level client call", clientPath, get(client, clientPath));
if (!api) {
throw new Error(`called with an invalid endpoint: ${endpoint}`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function createIndexPatternCache(): PatternCache {
},
set: (id: string, prom: any) => {
vals[id] = prom;
console.log("This is the set value", prom);
return prom;
},
clear: (id: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ export function getSearchParamsFromRequest(
const { getConfig } = dependencies;
const searchParams = getSearchParams(getConfig);

if (searchRequest.body.pit) {
console.log("pit is present");
delete searchParams.preference;
return {
body: searchRequest.body, ...searchParams,
};
} else {
console.log("PIT is not present here");
}
return {
index: searchRequest.index.title || searchRequest.index,
body: searchRequest.body,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* under the License.
*/

import { GetFieldsOptions, IIndexPatternsApiClient } from '../../common/index_patterns/types';
import { GetFieldsOptions, IIndexPatternsApiClient } from '../../common';

export class IndexPatternsApiServer implements IIndexPatternsApiClient {
async getFieldsForTimePattern(options: GetFieldsOptions = {}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export async function getDefaultSearchParams(uiSettingsClient: IUiSettingsClient
maxConcurrentShardRequests:
maxConcurrentShardRequests > 0 ? maxConcurrentShardRequests : undefined,
ignoreThrottled,
ignoreUnavailable: true, // Don't fail if the index/indices don't exist
ignoreUnavailable: false, // Don't fail if the index/indices don't exist
trackTotalHits: true,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,17 @@ export const opensearchSearchStrategyProvider = (

// ignoreThrottled is not supported in OSS
const { ignoreThrottled, ...defaultParams } = await getDefaultSearchParams(uiSettingsClient);

console.log("these are the default params",defaultParams)
const params = toSnakeCase({
...defaultParams,
...getShardTimeout(config),
...request.params,
});

if (params.body.pit) {
console.log("deleting the ignore unavailable values ");
delete params.ignore_unavailable;
}
console.log("these are the params",params);
try {
const client = await decideClient(context, request);
const promise = shimAbortSignal(client.search(params), options?.abortSignal);
Expand Down
Loading

0 comments on commit cd0b92f

Please sign in to comment.