Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make policies indexable #1053

Merged
merged 1 commit into from Dec 13, 2017
Merged

Conversation

Rosa-Fox
Copy link
Contributor

@Rosa-Fox Rosa-Fox commented Dec 8, 2017

Trello

  • Maps policy_groups, people, description and slug fields.
  • This is to set up the policy format to be migrated to the govuk search index.

@suzannehamilton suzannehamilton force-pushed the map-policy-fields-for-govuk-index branch 2 times, most recently from 781b363 to 4ed4f93 Compare December 11, 2017 15:35
@suzannehamilton
Copy link
Contributor

I've picked this PR up from Rosa, and I've moved the people and policy_group logic from PolicyPresenter to ExpandedLinksPresenter for consistency.

@@ -62,6 +66,12 @@ def content_ids(collection)
values_from_collection(expanded_links_item(collection), "content_id")
end

def slugs(type, path_prefix)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a nice cleanup.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only thought would be to change to to match: https://github.com/alphagov/rummager/pull/1053/files#diff-506cd05cce4cbe451fda1d266331a7bcR156

.gusb(%r{^/....

That way it will only match the prefix. :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made it more consistent. 👍 What do you think?

@@ -26,6 +25,16 @@ def initialize(payload)
@payload = payload
end

def description
if format == "policy"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE FOR THIS PR, but if we have time at the end of the quarter, it would be nice to try and remove the description where it is just a duplicate of content in the indexable_content field and see if it effect the score in any way.

That would enable us to remove this mess, plus some indexable content hacks.

- Maps `policy_groups`, `people`, `description` and `slug` fields.
- This is to set up the policy format to be migrated to the govuk search index.
@suzannehamilton suzannehamilton merged commit cdc863b into master Dec 13, 2017
@suzannehamilton suzannehamilton deleted the map-policy-fields-for-govuk-index branch December 13, 2017 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants