Skip to content

Conversation

@toastercup
Copy link
Member

@toastercup toastercup commented Jul 5, 2017

Purpose:

This PR implements the ability to search Legacy Posts by Tag(s). Originally, the issue was that providing a tag term in a general full-text search query no longer acted as expected. Specifically, searching for a tag like node-js would return results with node in the body/description/etc. This is correct full-text search behavior, but was not intended behavior for the team needing this functionality. To implement this functionality, we decided a separate search term just for tags was necessary for the feed and non-feed endpoints. The mappings for tags were explicitly defined to avoid hyphenated tags being tokenized as separate strings. Additionally, multiple, comma-separated tags can be specified, which will return any posts that match any of the provided tags.

JIRA:

https://cb-content-enablement.atlassian.net/browse/COR-789

Steps to Take On Prod

Upon deployment, you must rebuild the indices (bundle exec rake cortex:rebuild_indexes)

Changes:

  • Changes to setup

    • N/A
  • Architectural changes

    • N/A
  • Migrations

    • N/A
  • Library changes

    • N/A
  • Side effects

    • 'Related Post' behavior may be slightly different now, as it should now be properly returning related posts with tag matches.

Screenshots

  • Before
    N/A

  • After
    N/A

QA Links:

http://web.cortex-3.development.c66.me/

How to Verify These Changes

  • Specific pages to visit

    • N/A
  • Steps to take

    • Try adding a few Posts with multiple tags, included hyphenated tags
    • Try querying for those posts in the API: http://web.cortex-3.development.c66.me/api/v1/posts/feed?tags=tag1,tag2
    • Ensure that when querying for a post with a tag like node-js, that ?tags=node or ?tags=js do not return the post in question. Partial matches are not supported for search-by-tag.
    • Ensure 'related posts' works as expected, as well as standard full-text search
  • Responsive considerations

    • N/A

Relevant PRs/Dependencies:

N/A

Additional Information

  • I know @Casao has been waiting for this - pinging you!
  • Tests are failing right now - this is because another PR must be merged (which fixes tests) and then this branch will be rebased against develop.

Copy link
Contributor

@Casao Casao left a comment

Choose a reason for hiding this comment

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

Looks good, more or less what I had in my think day tweaks

Copy link

@mrfantasticwonders mrfantasticwonders left a comment

Choose a reason for hiding this comment

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

Looks good!

@toastercup toastercup merged commit 3dc501a into develop Jul 6, 2017
@toastercup toastercup deleted the bugfix/COR-789-Tag-Search-Issues branch July 6, 2017 18:48
@toastercup toastercup restored the bugfix/COR-789-Tag-Search-Issues branch July 6, 2017 18:48
@toastercup toastercup deleted the bugfix/COR-789-Tag-Search-Issues branch July 6, 2017 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants