MCPcopy
hub / github.com/MinishLab/semble / _run_search

Function _run_search

src/semble/cli.py:108–114  ·  view source on GitHub ↗

Handle the `search` subcommand.

(path: str, query: str, top_k: int, content: list[ContentType], max_snippet_lines: int | None)

Source from the content-addressed store, hash-verified

106
107
108def _run_search(path: str, query: str, top_k: int, content: list[ContentType], max_snippet_lines: int | None) -> None:
109 """Handle the `search` subcommand."""
110 index = _load_index(path, content)
111 results = index.search(query, top_k=top_k, max_snippet_lines=max_snippet_lines)
112 out = format_results(query, results, max_snippet_lines) if results else {"error": "No results found."}
113 print(json.dumps(out))
114 _maybe_save_index(index, path)
115
116
117def _run_find_related(

Callers 1

_cli_mainFunction · 0.70

Calls 4

format_resultsFunction · 0.90
_load_indexFunction · 0.85
_maybe_save_indexFunction · 0.85
searchMethod · 0.80

Tested by

no test coverage detected