Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / function
search_code
modules.code.router.search_code
PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.
PHAROS at 975a38dMIT license
Around this symbol
Search all symbolsLoading
| Symbol | File | Resolved by |
|---|---|---|
| hit_to_dict | context.py | through an import |
| get_embedder | embeddings.py | through an import |
| Retriever | retrieval.py | through an import |
| _filters | router.py | same file |
| _mode_unavailable | router.py | same file |
| Symbol | File | Resolved by |
|---|---|---|
| router | router.py | same file |
modules.code.router.search_codebackend/app/modules/code/router.py, lines 220–238Open source
@router.post("/search/code", response_model=SearchResponse)def search_code(body: SearchRequest, db: Session = Depends(get_sync_db)): """Chunk-level retrieval. ``mode=auto`` reports what it actually used.""" filters = _filters(db, body.repository, body.languages, body.kinds, body.path_prefix) try: outcome = Retriever(db, get_embedder()).search(body.query, mode=body.mode, k=body.k, filters=filters, hints=body.hints) except ModeUnavailable as exc: raise _mode_unavailable(exc) from exc return SearchResponse( query=outcome.query, mode_requested=outcome.mode_requested, mode_used=outcome.mode_used, embedding_model=outcome.embedding_model, warnings=outcome.warnings, results=[hit_to_dict(h, i) for i, h in enumerate(outcome.hits, start=1)], timings_ms=outcome.timings_ms, candidates=outcome.candidates, )What the index recorded
- Signature
def search_code(body: SearchRequest, db: Session):- File
backend/app/modules/code/router.py- Lines
- 220–238
- Parser
- python-ast
- Git blob
d914024790aaafe7234adda557677b76e4ad73d5- Call sites
- 9 named, 6 resolved, 3 left unlinked
- Outside this subset
- 1 more edges reach code outside the graph shown here
