7

We are using Tridion 2011 SP1 HR1, I have just managed to configure SI4T to successfully index DCPs into Solr (3.6.1) using the SI4T Solr Configuration 101 documentation here. Now the problem is when I publish a Component, as expected, Tridion is also publishing any items that use the Component which in turn is also being indexed.

Is there a way to stop this from happening? I don't want to change what happens on publish (as that's OOTB functionality from Tridion), although all the dependencies are using the same Schema I want to only index the Component that has been published.

If there is anything else I can add to this that could be of help please let me know.

UPDATE

Just seen this that tells me I can prevent certain component presentations from being indexed. However this is at a Component Template level. I would (presumably) need this setting to be at a Component level so I can pick which Component should/shouldn't be indexed.

Does it look like I'm going to need a Custom Resolver for this?

2 Answers 2

5

To prevent your other components being indexed you need to add a NoIndex metadata field to your schema. If the value in this field is "Yes" then the components will not be indexed. Note this also includes when you publish them directly - Im not sure if this is what you need...

UPDATE

Having just checked the source code, I see now that there is not currently a check on Component metadata. This is easy enough to add in SI4T.Templating.SearchData.ProcessComponentPresentation() method, in the conditional where it checks the component template, add a check on the component

if (cp.Component.IsIndexed() && ... rest of existing checks)
{
}

I will get this into the codebase shortly

3
  • Thanks Will. Do you mean I need to add a NoIndex metadata field to the Schema of the Component I'm publishing? If so, I did try this but still the dependencies were added to the Solr index. The only reference in the documentation is to add the NoIndex metadata field to the Component Template Metadata Schema but I need this at a Component level. Commented Jul 10, 2014 at 17:26
  • Sorry - I just checked the code and see that indeed component meta is not checked - its easy to fix, see updated answer
    – Will Price
    Commented Jul 10, 2014 at 22:01
  • Thanks Will. I have now added this customisation (along with other logic that was needed) and it works fine. Commented Jul 11, 2014 at 14:42
3

Given the complexities of the consequences of the requirement, this is something SI4T does not have at the moment, but anyone with a brilliant solution can say so here. ;)

The simplest thing would be to configure a set of Schema Ids on the Generate Index Data TBB, so that any Component which is in the render process, has that schema, it should or should not be indexed. For that, the Generate Index Data TBB should be altered or extended, but the amount of work is minimal.

If that does not fulfil your requirements, then the next simplest (but more tedious for content editors) thing to do would be to change or extend the Generate Index Data TBB, to check first whether a single Component should be indexed at all. You could set a metadata field on Components, Folders, Structure Groups (in case the components are on a page) or even entire Publications to check whether Component data should or should be indexed.

2
  • Thanks Raimond. With regards to your first recommendation, how would this work with components that share the same Schema which do not need to be published if it's a dependent item? I think option 2 sounds more like it will do what I want. I already have my NoIndex metadata field on my content Schema (following on from Wills suggestion) so now I just need to check for that setting in the Generate Index Data TBB and then index to Solr? By default I would have this setting set to 'Yes', and only those items will be indexed that have this setting unchecked, making it less tedious hopefully :D Commented Jul 10, 2014 at 18:27
  • The only place to not index dependant items in the publish transaction would be in a Resolver actually. There, you could check the NoIndex metadata field and possibly set the NoIndex metadata field to no during the publish transaction. This is rather exotic, but may the only way to fulfill your requirement.
    – Raimond
    Commented Jul 11, 2014 at 8:43

Your Answer

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

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