Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Add search for badges, programs to the API #240

Merged
merged 5 commits into from Jun 18, 2013
Merged

Conversation

brianloveswords
Copy link
Contributor

Fixes #236.

This adds recognition for the search query parameter to /v2/badges and /v2/programs.

Currently the search is only effective against the name property. I can adjust that if necessary.

Note, we still don't have categorical filtering on /v2/badges – currently the only way to filter is with search terms. I'm not sure if the frontend of CSOL requires categorical filtering (like we have for programs – things like age range, type of activity, categories, etc.); if so, we should open another ticket for it.

@cmcavoy to review.

@cmcavoy
Copy link
Contributor

cmcavoy commented Jun 18, 2013

reviewing...future iterations could include tags (although we're not tagging much right now in CSOL, we could...) and description.


* `issuer` - issuer shortname
* `tags` - list of tags the entry must have all of\*\*
* **search**: Filter out programs whose name isn't like the given string. "Likeness" is determined by generating a case-insensitive, unbounded regexp (i.e., `new Regexp(searchTerm, 'i')`).
Copy link
Contributor

Choose a reason for hiding this comment

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

is this a typo? "Filter out programs whose name isn't like the given string" do you mean is like the given string?

Copy link
Contributor

Choose a reason for hiding this comment

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

does this also mean that if wanted to get clever we could pass in regexes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not a typo, though I guess it could be clearer: We are filtering out programs that don't match.

And yeah, that does mean you can get clever and pass in regexps (as long as you don't wrap it with / and /)

@cmcavoy
Copy link
Contributor

cmcavoy commented Jun 18, 2013

I vote for immediate merge and deploy to staging.

giphy

brianloveswords added a commit that referenced this pull request Jun 18, 2013
Add search for badges, programs to the API
@brianloveswords brianloveswords merged commit 56ff276 into v2.0 Jun 18, 2013
@cmcavoy cmcavoy deleted the 236-search-api branch June 18, 2013 18:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add search to API
2 participants