Skip to content

Opportunity-search core

Current flow

search_opportunities_process accepts validated OpportunitySearchCriteria rather than a free-form MongoDB dictionary.

  1. Build the tenant/user hard filter from the same JOM configuration used by matching processing.
  2. Normalize requested skills and load the user's matching scores.
  3. If no scores exist at all, run one guarded user-opportunity recalculation; do not recalculate when existing scores were only excluded by “show more”.
  4. Intersect profile matches with explicit criteria when filters are present.
  5. Fill an undersized result set with a deterministic full-text/vector search.
  6. Run those independent searches concurrently and fuse their ranked lists locally with weighted RRF.
  7. Optionally rerank fallback offers against the user's attached job title using InferredTitle_embeddings.
  8. Format structured suggestions, persist returned IDs in state and emit safe streaming sub-steps.

Hard filters, exclusions and explicit user criteria are kept distinct so the search cannot accidentally broaden tenant visibility rules.

Index dependencies

The flow queries JobOffers through opportunities_autocomplete and the combined embeddings_index. See MongoDB indexes.