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

feature(#164046262): Users should be able to search for articles #56

Merged
merged 1 commit into from
May 6, 2019

Conversation

Etomovich
Copy link
Contributor

@Etomovich Etomovich commented May 6, 2019

Description


This PR adds custom filtering and search functionality. A user can be able to perform partial and full word searches depending on the search string he/she wants to search. This feature also enables the user to filter his/her search depending on the specific fields he/she wants to search. Currently, the fields that the user can search from are author, tags, title, description and body. In order for a user to search, he/she should use the following endpoint:

PUT /api/articles/user/search/ - Searches for all articles with the given search string

For the data pass the following dictionary and set value to be your search string:

{"search_string": <value>}

To filter by field the URL is as shown below, for the fields listed above:

PUT /api/articles/user/search/?query=tags - Filters for all articles with the given search string in the tag_list attribute

To filter multiple fields at the same time add the fields separated by commas as shown below:

PUT /api/articles/user/search/?query=tags,author,body,description - Filters for all articles with the given search string in the tag_list attribute

Type of Change


  • feature(a breaking change that allows users to search and filter the articles that they may want).

Checklist


  • Users should be able to search for articles.
  • Users should be able to filter articles according to the different fields
  • Add tests to show search functionality.

Related Stories


Add search functionality and custom filtering

@BrianSerem BrianSerem temporarily deployed to ah-legion-staging-pr-56 May 6, 2019 09:58 Inactive
@Etomovich Etomovich added the Work In Progress The task/feature you were working on is not yet complete. Show the team where you are so far. label May 6, 2019
…icles

- Users should be able to search for articles
- Users can filter for articles in either [tags, author, title, description, body]
- Add test to show functionality of both search and filter features

[Finishes #164046262]
Copy link
Contributor

@abulojoshua1 abulojoshua1 left a comment

Choose a reason for hiding this comment

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

LGTM

@abulojoshua1 abulojoshua1 merged commit 2467dcf into develop May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Work In Progress The task/feature you were working on is not yet complete. Show the team where you are so far.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants