Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/networkingRecommenderPOC.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { PdfReader } = require("pdfreader"); // commonjs import is necessary

import search from "../lib/search.js";
import {
BLUEPRINT_OPENSEARCH_TEST_INDEX,
BLUEPRINT_OPENSEARCH_PROD_INDEX,
BLUEPRINT_RESPONSE_MAP
} from "../constants/indexes.js";
import { QueryCommand } from "@aws-sdk/lib-dynamodb";
Expand Down Expand Up @@ -188,7 +188,7 @@ async function run(eventID, year) {
console.log(parsedProfiles);

await search.indexDocuments({
indexName: BLUEPRINT_OPENSEARCH_TEST_INDEX,
indexName: BLUEPRINT_OPENSEARCH_PROD_INDEX,
documents: parsedProfiles
});
}
Expand Down
7 changes: 3 additions & 4 deletions services/interactions/handler.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BLUEPRINT_OPENSEARCH_PROD_INDEX, OPENSEARCH_INDEX_TOP_K } from "../../constants/indexes";
import {
MEMBERS2026_TABLE,
PROFILES_TABLE,
Expand All @@ -8,7 +9,7 @@ import handlerHelpers from "../../lib/handlerHelpers";
import helpers from "../../lib/handlerHelpers";
import search from "../../lib/search";
import {
TYPES, BLUEPRINT_OPENSEARCH_TEST_INDEX, OPENSEARCH_INDEX_TOP_K
TYPES
} from "../profiles/constants";
import {
handleConnection,
Expand All @@ -34,10 +35,8 @@ export const recommend = async (event, ctx, callback) => {
type: "number"
}
});
// Uncomment below to use staging or prod index
// const indexToUse = process.env.ENVIRONMENT === "STAGING" ? BLUEPRINT_OPENSEARCH_STAGING_INDEX : BLUEPRINT_OPENSEARCH_PROD_INDEX;
const result = await search.retrieveTopK({
indexName: BLUEPRINT_OPENSEARCH_TEST_INDEX, // TODO: change to indexToUse later
indexName: BLUEPRINT_OPENSEARCH_PROD_INDEX,
queryText: data.query,
topK: data.topK || OPENSEARCH_INDEX_TOP_K,
});
Expand Down
Loading