Skip to content

Commit

Permalink
Merge pull request #102 from NYPL/SCC-4344/add-recordTypeId
Browse files Browse the repository at this point in the history
Scc 4344/add record type
  • Loading branch information
charmingduchess authored Dec 3, 2024
2 parents 23607d8 + fa795ef commit c4affcd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/elastic-search/index-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ exports.schema = () => ({
publicDomain: propertyTemplates.boolean,
publisherLiteral: propertyTemplates.fulltextWithRawFolded,
publicationStatement: propertyTemplates.exactStringNotIndexed,
recordType: propertyTemplates.exactString,
recordTypeId: propertyTemplates.exactString,
serialPublicationDates: propertyTemplates.exactStringNotIndexed,
seriesStatement: propertyTemplates.fulltextWithRawFolded,
shelfMark: {
Expand Down
4 changes: 2 additions & 2 deletions lib/es-models/bib.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,8 @@ class EsBib extends EsBase {
}

recordTypeId () {
const recordType = this.bib.ldr()?.recType
if (recordType) return recordType
const recordTypeId = this.bib.ldr()?.recType
if (recordTypeId) return recordTypeId
else return null
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/mapping-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ kmsSetCredentials(awsCreds)
exports.getMapping = async (index) => {
const client = await esClient.client()
const resp = await client.indices.getMapping({ index })
return resp.body[index].mappings.resource.properties
return resp.body[index].mappings.properties
}

/**
Expand Down
5 changes: 2 additions & 3 deletions test/unit/scripts-mapping-check.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ describe('scripts/mapping-check', () => {
return {
body: {
[index]: {
mappings: {
resource: { properties: fakeMappings }
}
mappings: { properties: fakeMappings }

}
}
}
Expand Down

0 comments on commit c4affcd

Please sign in to comment.