Skip to content

[SEARCH] Port Typesense search to student-facing StudentHub app #44

Description

@BAWES

Context

The meilisearch branch on the studenthub (student-facing) repo had a parallel Meilisearch implementation. The last commit on that branch was 1554f3d — "Fix initial facet filters" (Nov 13 2025), also indicating the same facet count problem we hit on the staff app.

Once #41 and #42 are merged on the staff app, the same TypesenseService pattern should be ported to the student app so both share the same backend search infrastructure.

Depends on: #40 (backend endpoints, same /search/key and /search/search endpoints serve both apps)

Scope

1. Port TypesenseService

Copy src/app/services/typesense.service.ts from studenthub-staff (post #41 merge) into studenthub student app. The service is identical — same backend endpoints.

2. Student Search Context Differences

The student app search is job/opportunity search, not candidate search. The facets will differ:

Facet Attribute
Job Type job_type
Work Type work_type (full-time, part-time, internship)
Location location.country_id
Industry industry_id
Company company_id
Salary Range salary_min, salary_max (range filter, not facet)
Has Deadline has_deadline

Create a JobSearchService mirroring CandidateSearchService with job-specific facets and collection name from environment.

3. Geo Filter

The studenthub meilisearch branch added geo filter in commit eb6849dd — "New meilisearch geo filter". Port this to Typesense geo search syntax:

// Meilisearch geo filter
`_geoRadius(${lat}, ${lng}, ${radiusMeters})`

// Typesense equivalent  
filter_by: `location.coordinates:(${lat}, ${lng}, ${radiusKm} km)`
sort_by: `location.coordinates(${lat}, ${lng}):asc`

4. Update environment files

// environment.ts
typesenseJobCollection: 'jobs'
typesenseCandidateCollection: 'candidates' // if student app also searches candidates

5. Remove Meilisearch references

  • Delete MeilisearchService from student app
  • Remove meilisearch from package.json if it was added
  • Clean up any environment.meilisearch* keys

Acceptance Criteria

  • TypesenseService in student app points to same /search/key and /search/search backend endpoints as staff app
  • JobSearchService created with job-specific facets
  • Job search page returns results via Typesense
  • Facet counts work correctly (all values visible regardless of active filters)
  • Geo filter ported to Typesense syntax
  • Meilisearch service and references fully removed
  • No TypeScript errors

Branch

Branch from master of studenthub repo. Name: feature/typesense-service

Note on Repository

This issue is tracked on studenthub-staff for cross-reference but the actual work is in the studenthub repo. Create a parallel issue there once #41 and #42 are complete and the pattern is validated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions