bounswe / bounswe2024group7

Collaborative hub for 2024Group7
https://bounswe.github.io/bounswe2024group7/
4 stars 3 forks source link

Implement/ enhance Search functionality #201

Open m1u1s1 opened 3 days ago

m1u1s1 commented 3 days ago

Issue: Enhance Search Functionality for Exercises and Forum Posts

Overview:

Enhance the search functionality in the application to provide more intuitive, relevant, and user-friendly results for both exercises and forum posts. The feature will leverage semantic search for better matching and ranking of results, and integrate hashtags within forum posts to boost discoverability.


Key Features:

  1. Exercise Database Search:

    • Search across exercise fields like name, bodyPart, targetMuscle, and equipment.
    • Use semantic search to allow for fuzzy and contextual matches. For example:
      • A query for "glute exercises" should return exercises targeting glutes, even if the exact term "glute exercises" is not in the database.
      • Searching for "stretch" should prioritize exercises containing "stretch" in the name or instructions.
  2. Forum Post Search:

    • Include posts in search results to allow users to discover content based on hashtags and descriptions.
    • Match search terms with:
      • Post descriptions (similar to Instagram).
      • Hashtags used within posts.
    • Implement hashtag prioritization:
      • Posts with hashtags matching search terms should rank higher.
      • Example: Searching for "fitness goals" will return posts tagged with #fitness or #goals.

Technical Approach:

  1. Search Indexing:

    • Implement a search indexing system (e.g., Elasticsearch, Meilisearch, or a similar tool).
    • Create separate indexes for:
      • Exercises: Index fields like name, bodyPart, targetMuscle, equipment, and instructions.
      • Posts: Index the description and hashtags.
  2. Semantic Search:

    • Use pre-trained language models (e.g., Sentence Transformers, OpenAI Embeddings) to enable semantic understanding of queries.
    • Ensure results consider synonyms, context, and user intent.
  3. Integration with Hashtags:

    • Parse hashtags from post descriptions during data entry or indexing.
    • Match hashtags with search queries and boost their relevance in results.
  4. Search Filters:

    • Allow users to filter search results by:
      • Exercise-Specific Filters: bodyPart, targetMuscle, equipment.
      • Post-Specific Filters: Date, number of likes, or hashtags.

Expected Outcomes:


Acceptance Criteria:

  1. Users can search for exercises using keywords, phrases, or general terms (e.g., "leg stretches").
  2. Users can search for forum posts by descriptions or hashtags (e.g., "#strengthTraining").
  3. Results are ranked semantically and contextually.
  4. Filters are available for narrowing down results (e.g., by bodyPart or hashtags).
  5. The search system performs efficiently and scales with the database size.