@@ -198,6 +198,7 @@ import { IDS_ATTRIBUTES } from '../domain/attribute-utils';
198198import { schemaRelationsRefDefinition } from '../schema/schema-relationsRef' ;
199199import type { FiltersWithNested } from './middleware-loader' ;
200200import { pushAll , unshiftAll } from '../utils/arrayUtil' ;
201+ import { ATTACHMENT_PROCESSOR_EXTRACTED_PROPS_ELASTICSEARCH , ATTACHMENT_PROCESSOR_EXTRACTED_PROPS_OPENSEARCH } from './attachment-processor-props' ;
201202
202203const ELK_ENGINE = 'elk' ;
203204const OPENSEARCH_ENGINE = 'opensearch' ;
@@ -299,59 +300,6 @@ const oebp = (queryResult: any): any => {
299300 return queryResult . body ;
300301} ;
301302
302- // List of fields extracted by the attachment ingest processor.
303- // The full list is available in the Elasticsearch docs:
304- // (https://www.elastic.co/guide/en/elasticsearch/reference/8.19/attachment.html#attachment-fields).
305- const ATTACHMENT_PROCESSOR_EXTRACTED_PROPS_ELASTICSEARCH = [
306- 'content' ,
307- 'title' ,
308- 'author' ,
309- 'keywords' ,
310- 'date' ,
311- 'content_type' ,
312- 'content_length' ,
313- 'language' ,
314- 'modified' ,
315- 'format' ,
316- // identifier, NOT EXTRACTED
317- // contributor, NOT EXTRACTED
318- // coverage, NOT EXTRACTED
319- 'modifier' ,
320- 'creator_tool' ,
321- // publisher, NOT EXTRACTED
322- // relation, NOT EXTRACTED
323- // rights, NOT EXTRACTED
324- // source, NOT EXTRACTED
325- // type, NOT EXTRACTED
326- 'description' ,
327- 'print_date' ,
328- 'metadata_date' ,
329- // latitude, NOT EXTRACTED
330- // longitude, NOT EXTRACTED
331- // altitude, NOT EXTRACTED
332- // rating, NOT EXTRACTED
333- 'comments' ,
334- ] as const ;
335-
336- // List of fields extracted by the attachment ingest processor, for OpenSearch.
337- // The full list is available in the OS docs:
338- // (https://docs.opensearch.org/latest/install-and-configure/additional-plugins/ingest-attachment-plugin/#extracted-information),
339- // and code shows the check rejects unknown fields with an exception:
340- // https://github.com/opensearch-project/OpenSearch/blob/315481148edaa43410e2e9f1801ec903fd62ec20/plugins/ingest-attachment/src/main/java/org/opensearch/ingest/attachment/AttachmentProcessor.java#L277
341- const ATTACHMENT_PROCESSOR_EXTRACTED_PROPS_OPENSEARCH = [
342- 'content' ,
343- 'title' ,
344- 'author' ,
345- 'keywords' ,
346- 'date' ,
347- 'content_type' ,
348- 'content_length' ,
349- 'language' ,
350- ] as const ;
351-
352- export type AttachmentProcessorExtractedProp = Mutable < typeof ATTACHMENT_PROCESSOR_EXTRACTED_PROPS_ELASTICSEARCH > [ number ]
353- & Mutable < typeof ATTACHMENT_PROCESSOR_EXTRACTED_PROPS_OPENSEARCH > [ number ] ;
354-
355303export const elConfigureAttachmentProcessor = async ( ) : Promise < boolean > => {
356304 let success = true ;
357305 if ( engine instanceof ElkClient ) {
0 commit comments