tusmanakhter / MigrantHub

MIT License
4 stars 3 forks source link

Fix and Improve Search #203

Closed tusmanakhter closed 5 years ago

tusmanakhter commented 5 years ago

We have gotten feedback to use better search methods, full text search instead of regex, this should be implemented. At the same time we can improve the UI of the search and the displayed results.

The new search allows searching services through its title, summary and description, with more priority added to title, then summary, then description. Similarly searching through events will have priority for its title then description. Search results are sorted by how close they are to the search term. Lastly, friends are removed from the search results page as friends functionality is on pause.

Story Points: 2 Priority: High Risk: Low

Tasks:

Demo Steps:

Pre-conditions: Run these 2 commands on mongo: db.services.createIndex( {serviceTitle: "text", serviceSummary: "text", serviceDescription: "text"}, {weights: { serviceTitle: 3, serviceSummary:2, serviceDescription:1 }})

db.events.createIndex( {eventName: "text", description: "text"}, {weights: { eventName: 2, description: 1 }})

  1. Login to MigrantHub
  2. Use the search bar to search for services and/or events