6

We are using SI4T and Solr to provide search on our site.

We are successfully publishing Dynamic Component Presentations to our Solr index, and have now moved on to publishing binary files.

When publishing Dynamic Component Presentations we were able to add custom fields to the Solr documents created. We did this by adding new elements to the xml generated by SI4T.

When we publish pdf's we can see the binary_content field, and the other default fields, but we can't see an obvious way to add custom fields to these documents.

Whats the best way to extend SI4T to add custom fields when publishing binary files using SI4T?

UPDATE

The PDF is part of a multimedia component (based on a download schema) with various metadata fields.

The download component has a dynamic CT associated with it, which contains the SI4T TBBs + a TBB to publish the PDF file.

Using this approach we end up with 2 documents in Solr. One for the download component and our custom fields (but not the content of the PDF) and one for the PDF itself (containing the PDF content, but no custom fields)

2 Answers 2

4

There are two ways to add custom fields to the xml thats being read by SI4T. In the blog post below its described by using a meta schema where you can connect fields. If the information of the binary files is already in tridion I suggest this would be the best approach.

Another way is the last chapter in the blog post; "Not enough? Extend with your own logic" In here you can add any logic you want to the custom xml fields. If you think this is not described enough what you want to achieve. Please provide more information what you want to do so we can help you.

http://www.tridiondeveloper.com/inside-si4t-search-integrations-controlling-what-gets-indexed

1
  • Hi Jarno, thank you for your answer. The approach you suggest we have used for content components, but it doesn't work for multimedia components. Please see the updates to my question. Jul 22, 2014 at 7:30
2

One earlier version of SI4T (when it wasn't called SI4T) actually had the possibility of indexing metadata fields on a Multimedia Component with indexing binary content at the same time. That has been stripped out, mainly because of the hassle it took to match metadata content with the associated binary during a publish transaction. Still it is one of the cleaner indexing solutions. Let me know if you are interested in taking this up.

Seeing that you have two documents in Solr now, you should also be able to merge both index actions into one copy-field in the Solr schema or be creative in how you get the search results. Basically, in search-index land it is perfectly accepted to have two documents in the index, but with different tokens or index capability in order to allow users to search with more search options. This page provide a good starting point to get creative.

5
  • Raimond, ironically we are also using SI4T for indexing components and binaries :-) Can I just ask, does what you've said above indicate that we can potentially merge two indexes together? I also have the same issue where publishing a Component that contains a component link as a PDF indexes as 2 separate items, one for the Component and the other for the Binary. Can we combine the two? Jul 23, 2014 at 21:41
  • Just to add to this, it's not the indexes that I need to merge, it's two items in the index that need merging together so when a user searches for text in a specific binary it also returns content from the content Component. Jul 24, 2014 at 7:30
  • Yeh I know what you mean. If you want this, it'll require quite some rework in SI4T. Maybe we should take this offline?
    – Raimond
    Jul 24, 2014 at 7:32
  • Hi Raimond, sure why not? My email is in my bio. Jul 24, 2014 at 12:29
  • Hi Raimond, thanks for such a detailed answer. We are going to look into the first example you suggest. Do you have an example of how to access multimedia component metadata in a storage extension? Jul 24, 2014 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.