Skip to content

Commit

Permalink
field autocomplete fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
kadamidev committed Sep 17, 2024
1 parent 9850a81 commit 98e96e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion desci-server/src/controllers/search/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const singleQuery = async (
}

if (entity === 'fields') {
searchEntity = 'subfields'; // Overwrite as fields are accessible via 'topics' index
searchEntity = 'subfields'; // Overwrite as fields are accessible via 'subfields' index
logger.info(
{ entity, searchEntity },
`Entity provided is '${entity}', overwriting with '${searchEntity}' because ${entity} is accessible in that index.`,
Expand Down
4 changes: 2 additions & 2 deletions desci-server/src/services/ElasticSearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const RELEVANT_FIELDS = {
works: ['title', 'abstract'],
authors: ['display_name', 'orcid', 'last_known_institution', 'authors.affiliation'],
topics: ['display_name'],
subfields: ['subfield_display_name'],
fields: ['subfield_display_name'],
concepts: ['display_name'],
sources: ['display_name', 'publisher', 'issn_l', 'issn'],
autocomplete_full: ['title', 'publisher', 'primary_id'],
Expand Down Expand Up @@ -262,7 +262,7 @@ function getRelevantFields(entity: string) {
if (entity === 'authors') return RELEVANT_FIELDS.authors;
if (entity === 'topics') return RELEVANT_FIELDS.topics;
if (entity === 'concepts') return RELEVANT_FIELDS.concepts;
if (entity === 'subfields') return RELEVANT_FIELDS.subfields;
if (entity === 'fields') return RELEVANT_FIELDS.fields;
if (entity === 'institutions') return RELEVANT_FIELDS.institutions;
if (entity === 'sources') return RELEVANT_FIELDS.sources;
if (entity === 'autocomplete_full') return RELEVANT_FIELDS.autocomplete_full;
Expand Down

0 comments on commit 98e96e8

Please sign in to comment.