Skip to content

Commit

Permalink
update search fields weights
Browse files Browse the repository at this point in the history
  • Loading branch information
folland87 committed Mar 22, 2024
1 parent 5c6c0ae commit e36f4a9
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 21 deletions.
10 changes: 6 additions & 4 deletions client/src/api/authors/_utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
export const FIELDS = [
"id^10",
"externalIds.id^3",
"fullName^3",
"coContributors.fullName^1",
"publications.title.default^2",
"publications.summary.default^2",
"publications.publication^2",
"domains.label.*^2",
"recentAffiliations..strucrue.label.*",
"domains.code^2",
"recentAffiliations.structure.label.*",
"recentAffiliations.structure.acronym.*",
"recentAffiliations.structure.id",
"awards.label.*"
"awards.label.*",
]

export const LIGHT_SOURCE = [
"id", "fullName", "domains", "orcid",
"id", "fullName", "domains", "orcid", "id_hal",
"idref", "recent_affiliations", "topDomains",
]
29 changes: 25 additions & 4 deletions client/src/api/organizations/_utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
export const FIELDS = [
"id^3",
"id^5",
"acronym.*^5",
"externalIds.id^3",
"alias^3",
"label.*^3",
"acronym.*^3",
"description.*^2",
"address.city",
"address.address",
"address.postcode",

"publications.id^2",
"publications.title.default^2",
"publications.summary.default",
"publications.domains.label.*^2",
"publications.domains.code^2",

"projects.label.*^2",
"projects.acronym.*",
"description.*^2",
"alias^3",
"projects.id^2",

"badges.label.*",
"badges.code",

"patents.id^2",
"patents.title.*^2",

"agreements.type^2",

"awards.label^2",
"awards.summary",

"web_content"
]
export const LIGHT_SOURCE = ["label.*", "acronym.*", "address.main", "address.city", "kind", "level", 'nature', 'id', "creationYear", "isFrench", "active"]
Expand Down
7 changes: 4 additions & 3 deletions client/src/api/patents/_utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
export const FIELDS = [
"id.keyword^10",
"patents.id^10",
"title.*^3",
"summary.*^3",
"domains.label.*",
"domains.code^10",
"id.keyword^10",
"patents.id^10",
"domains.code^5",
];

export const LIGHT_SOURCE = [
"title",
"id",
Expand Down
18 changes: 13 additions & 5 deletions client/src/api/projects/_utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,23 @@ export const FIELDS = [
"acronym.*^3",
"description.*^2",
"domains.label.*",
"call.id",
"call.label",
"action.id",
"action.label.*",
"keywords.*",

"publications.id",
"publications.title.*",
"publications.summary.*",
"publications.authors.fullName",
"publications.authors.person",
"publications.domains.label.*",
"publications.domains.code",

"participants.structure.label.*",
"participants.structure.acronym.*",
"participants.structure.id",
"call.label",
"keywords.*",
"action.id",
"action.label.*",
"participants.label.*",
]
export const LIGHT_SOURCE = [
"label.*",
Expand Down
17 changes: 16 additions & 1 deletion client/src/api/publications/_utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
export const FIELDS = [
"id^10",
"externalIds.id^3",
"title.*^3",
"authors.fullName^3",
"summary.*^2",
"domains.label.*^2",
"domains.code^2",
"authors.fullName^2",
"authors.denormalized.id^3",
"authors.denormalized.orcid^3",
"authors.denormalized.id_hal^3",
"authors.denormalized.idref^3",
"authors.affiliations.ids.id",
"authors.affiliations.name",
"source.title",
"source.journalIssns",
"source.publisher",
"affiliations.id",
"affiliations.label.*",
"softwares.softwareName",
"softwares.contexts",
"softwares.wikidata",
"projects.id",
"projects.label.*",
"projects.acronym.*"
]
export const LIGHT_SOURCE = ["title.*", "authors.fullName", "authors.person", "authors.role", "source.*", "isOa", 'type', 'id', "year"]
9 changes: 6 additions & 3 deletions client/src/pages/search/components/authors/author-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ export default function AuthorItem({ data: author, highlight }: ItemProps<LightA
)}
</Text>
<div className="fr-mt-1w fr-badge-group">
{[author.id.replace("idref", ""), author.orcid]
?.filter((id) => id)
.map((id, i) => <CopyBadge key={id} size="sm" copyText={id}>{(i === 0) ? 'idref' : 'orcid'} : {id}</CopyBadge>)
{[
{ id: author.id.replace("idref", ""), type: "idref" },
{ id: author.orcid, type: 'orcid' },
{ id: author.id_hal, type: 'idhal' }]
.filter((identifier) => identifier.id)
.map(({ id, type }) => <CopyBadge key={id} size="sm" copyText={id}>{type} : {id}</CopyBadge>)
}
</div>
{Object.values(highlight || {}).map((value, i) => (
Expand Down
3 changes: 2 additions & 1 deletion client/src/types/author.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { LightPublication } from "./publication";
export type LightAuthor = {
id: string;
idref: string;
orcid: string;
orcid?: string;
id_hal?: string;
fullName: string;
recent_affiliations: {
label: string;
Expand Down

0 comments on commit e36f4a9

Please sign in to comment.