diff --git a/src/models/generated/schemas.d.ts b/src/models/generated/schemas.d.ts index c2715a52..34797b56 100644 --- a/src/models/generated/schemas.d.ts +++ b/src/models/generated/schemas.d.ts @@ -879,6 +879,10 @@ export interface Image { * The unique identifier of the image */ uid: string; + /** + * Image caption + */ + caption?: string; /** * The unique identifier of the issue that the image belongs to. */ diff --git a/src/models/generated/schemasPublic.d.ts b/src/models/generated/schemasPublic.d.ts index 242c7188..f82e26d1 100644 --- a/src/models/generated/schemasPublic.d.ts +++ b/src/models/generated/schemasPublic.d.ts @@ -382,6 +382,10 @@ export interface Image { * The unique identifier of the image */ uid: string; + /** + * Image caption + */ + caption?: string; /** * The unique identifier of the issue that the image belongs to. */ diff --git a/src/models/generated/solr.d.ts b/src/models/generated/solr.d.ts index 56e335cf..d93a590a 100644 --- a/src/models/generated/solr.d.ts +++ b/src/models/generated/solr.d.ts @@ -26,6 +26,7 @@ export interface Image { coords_is?: number[]; front_b?: boolean; iiif_url_s?: string; + iiif_link_s?: string; cc_b?: boolean; rights_data_domain_s?: string; rights_copyright_s?: string; diff --git a/src/schema/schemas/Image.json b/src/schema/schemas/Image.json index 3a582a7f..d640afbb 100644 --- a/src/schema/schemas/Image.json +++ b/src/schema/schemas/Image.json @@ -9,6 +9,10 @@ "type": "string", "description": "The unique identifier of the image" }, + "caption": { + "type": "string", + "description": "Image caption" + }, "issueUid": { "type": "string", "description": "The unique identifier of the issue that the image belongs to." diff --git a/src/schema/schemasPublic/Image.json b/src/schema/schemasPublic/Image.json index 3a582a7f..d640afbb 100644 --- a/src/schema/schemasPublic/Image.json +++ b/src/schema/schemasPublic/Image.json @@ -9,6 +9,10 @@ "type": "string", "description": "The unique identifier of the image" }, + "caption": { + "type": "string", + "description": "Image caption" + }, "issueUid": { "type": "string", "description": "The unique identifier of the issue that the image belongs to." diff --git a/src/schema/solr/Image.json b/src/schema/solr/Image.json index 4b99543d..11016d6d 100644 --- a/src/schema/solr/Image.json +++ b/src/schema/solr/Image.json @@ -28,6 +28,7 @@ }, "front_b": { "type": "boolean" }, "iiif_url_s": { "type": "string", "format": "uri" }, + "iiif_link_s": { "type": "string", "format": "uri" }, "cc_b": { "type": "boolean" }, "rights_data_domain_s": { "type": "string" }, "rights_copyright_s": { "type": "string" }, diff --git a/src/services/images/images.class.ts b/src/services/images/images.class.ts index 4a31b591..4b37fc51 100644 --- a/src/services/images/images.class.ts +++ b/src/services/images/images.class.ts @@ -11,6 +11,7 @@ const ImageSimilarityVectorField: keyof ImageDocument = 'dinov2_emb_v1024' export interface FindQuery { similar_to_image_id?: string + term?: string limit?: number offset?: number } @@ -24,6 +25,10 @@ export class Images implements Pick { uid: doc.id!, ...(doc.linked_ci_s != null ? { contentItemUid: doc.linked_ci_s } : {}), issueUid: doc.meta_issue_id_s!, - previewUrl: doc.iiif_url_s!, + previewUrl: doc.iiif_url_s ?? doc.iiif_link_s!, + ...(doc.caption_txt != null ? { caption: doc.caption_txt.join('\n') } : {}), } } diff --git a/src/services/images/images.schema.ts b/src/services/images/images.schema.ts index 808640cf..a7b32a16 100644 --- a/src/services/images/images.schema.ts +++ b/src/services/images/images.schema.ts @@ -24,7 +24,7 @@ const similarToImageId: QueryParameter = { } const findParameters: MethodParameter[] = [ - // parameterTerm, + parameterTerm, similarToImageId, ...getStandardParameters({ method: 'find', maxPageSize: 100 }), ]