1

I'm working with Crafter 2.5.10 with the following content model

Pages -> Includes Files and Components (File Component)

File Component - > Also includes other files

I need to perform a search (Solr query) of a given keyword(s) against files metadata, i.e. If I search for "Potato" and I have a PDF file with the word "Potato" inside of it, that would come as result match. When I get the result of the mentioned query I need to the Information of the page where this file is located (included).

Using the SearchAttachmentWithExternalMetadataPostProcessor I'm able to get the metadata of the files that are included directly into the page. But for the files that are included into File Components, I only get the information that is coming from the component that includes the file.

Is there a way to merge the metadata of the file + the parent component + the parent page component

CL1MB3R
  • 145
  • 9

1 Answers1

1

If you want something like page XML + component XML associated to file + file content itself in a single Solr document it's not possible, because there's no access to the extracted file content when indexing, the extraction is done by Solr and is completely separate from page indexing.

I think you have basically 2 options: search for the page associated to the component/file after doing the first query, or create a processor that adds some of the page metadata when indexing the component/file.

Alfonso Vasquez
  • 598
  • 3
  • 10