bounswe / bounswe2017group5

Interestr - Build your own interest-based community
MIT License
6 stars 3 forks source link

Template Based Search (Backend) #200

Closed Morgazipa closed 6 years ago

Morgazipa commented 6 years ago

About

To initiate the effort, I implemented a backend view for template based search. It accepts template id and a list of constraints, and returns a list of posts which satisfy each constraint simultaneously. At the moment, no validation of any sort is done. Supported filtering query types are "greater than", "less than", "equals" and "contains". A simple test is given for the purpose of illustration. The search makes use of JSON query capabilities of PostgreSQL. Also, "OR" combinations of queries are not possible.

Any feedback/change request is welcome.

Changes

smddzcy commented 6 years ago

Looks cool. I'll test it and implement its frontend if it works 👌

smddzcy commented 6 years ago

Default Template Search (no template_id)

screen shot 2017-12-25 at 23 57 36 screen shot 2017-12-25 at 23 57 16

Some Other Template Search

screen shot 2017-12-25 at 23 58 30 screen shot 2017-12-25 at 23 58 48

(results array is a little big, so only the data part is shown here which is enough I guess)

Morgazipa commented 6 years ago

Thanks for both review and edge case handling. If it is okay for frontend team, it is also okay for me :D

smddzcy commented 6 years ago

Frontend team, sure... 😴