Closed dpford closed 10 years ago
Looks good to me, but I'd prefer to have @rosskarchner merge.
This seems like a bug in self.type-- it should always reflect the type of the hit, so in your scenario, "a". Right?
After speaking with Ross, I think this solution is going to need some reworking. These elevated /a/ posts shouldn't be indexed as type /b/; rather, this should happen at the query level.
This issue has been addressed and re-worked in https://github.com/cfpb/sheer/pull/61
Before, when permalinks were created, they were using the rule dictated by the post type where the post was indexed in ES.
For example: if we have two post types, /a/ and /b/. We want to include a few of the /a/ posts in /b/, but their permalinks are showing up as /b/slug even though they are of type /a/.
Now if you send a 'type_for_url' into the hit_dict, the permalink will reflect the proper type.