I have built a custom peronsalization rule that sets a theme against a component. Each user can also choose a site theme which is stored against a contact.
I then want to use this logic to build up themed search results. So person in theme A will see search results A and so on.
Currently in the crawler I get all renderings I then parse the renderings rule.Condition as my custom rule which lets me get the theme. I then use the rule.Actions to get the datasource which lets me get the fields to be indexed.
This works when my rule is use datasource A for theme A and datasource B for theme B but I'm afraid it wont be robust with all rule combinations "hide", "except where" etc
Is there a way to use the sitecore's existing logic which determines what datasource to use given a personalisation rule?