From 29ec8ea8e360d0daf93d193097a1ca3d6fe924c3 Mon Sep 17 00:00:00 2001 From: Hina Shah Date: Mon, 9 Sep 2024 12:20:06 -0400 Subject: [PATCH] STYLE: changing text for explanation tab --- .../search/concept-modal/tabs/explanation.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/search/concept-modal/tabs/explanation.js b/src/components/search/concept-modal/tabs/explanation.js index 4a832a3b..65274951 100644 --- a/src/components/search/concept-modal/tabs/explanation.js +++ b/src/components/search/concept-modal/tabs/explanation.js @@ -91,16 +91,16 @@ export const ExplanationTab = ({ result }) => { .reduce((acc, cur) => { const { fieldMatch, termMatch, source, value } = cur const [fieldMatchName, fieldMatchDescription] = ( - fieldMatch === "name" ? ["Name", "The name of this concept"] - : fieldMatch === "description" ? ["Description", "The description of this concept"] - : fieldMatch === "search_terms" ? ["Search terms", "Synonymous names for this concept"] - : fieldMatch === "optional_terms" ? ["Related terms", "Search terms for concepts related to this concept"] + fieldMatch === "name" ? ["Concept Name", "Contribution to the score because the search query matched this concept's name"] + : fieldMatch === "description" ? ["Description", "Contribution to the score because we found the search query in this concept description"] + : fieldMatch === "search_terms" ? ["Synonyms", "Contribution to the score because we found the search query in this concept's synonymns"] + : fieldMatch === "optional_terms" ? ["Related terms", "Contribution to the score because we found the search query among this concept's semantically related terms"] : ["", ""] ) - const advancedBreakdownString = ` ${ fieldMatchName.endsWith("s") ? "contain" : "contains"} the term "${ termMatch }"` + const advancedBreakdownString = `term "${ termMatch }"` if (fieldMatch && termMatch) acc.push({ name: `${ fieldMatchName }`, - description: `${ fieldMatchDescription }${ advancedBreakdown ? advancedBreakdownString : ""}`, + description: advancedBreakdown ? `${ fieldMatchDescription.replace("query", advancedBreakdownString) }` : `${fieldMatchDescription}`, key: source, matchedField: fieldMatch, matchedTerms: termMatch, @@ -172,10 +172,10 @@ export const ExplanationTab = ({ result }) => { fontSize: 15, fontWeight: 500 }}> - Score breakdown + Explanation for this concept's relation to search term
- Why am I seeing this result? + What does the total score returned by the search mean??