cfpb / sheer

A tool for loading arbitrary content into Elasticsearch and serving that content on the web.
Creative Commons Zero v1.0 Universal
29 stars 23 forks source link

Added type_for_url for more accurate permalinks #60

Closed dpford closed 10 years ago

dpford commented 10 years ago

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.

Scotchester commented 10 years ago

Looks good to me, but I'd prefer to have @rosskarchner merge.

rosskarchner commented 10 years ago

This seems like a bug in self.type-- it should always reflect the type of the hit, so in your scenario, "a". Right?

dpford commented 10 years ago

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.

dpford commented 10 years ago

This issue has been addressed and re-worked in https://github.com/cfpb/sheer/pull/61