mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
feat: Enhance CodexLens search functionality with new parameters and result handling
- Added search limit, content length, and extra files input fields in the CodexLens manager UI. - Updated API request parameters to include new fields: max_content_length and extra_files_count. - Refactored smart-search.ts to support new parameters with default values. - Implemented result splitting logic to return both full content and additional file paths. - Updated CLI commands to remove worker limits and allow dynamic scaling based on endpoint count. - Introduced EmbeddingPoolConfig for improved embedding management and auto-discovery of providers. - Enhanced search engines to utilize new parameters for fuzzy and exact searches. - Added support for embedding single texts in the LiteLLM embedder.
This commit is contained in:
@@ -494,9 +494,13 @@ class ChainSearchEngine:
|
||||
else:
|
||||
# Use fuzzy FTS if enable_fuzzy=True (mode="fuzzy"), otherwise exact FTS
|
||||
if enable_fuzzy:
|
||||
fts_results = store.search_fts_fuzzy(query, limit=limit)
|
||||
fts_results = store.search_fts_fuzzy(
|
||||
query, limit=limit, return_full_content=True
|
||||
)
|
||||
else:
|
||||
fts_results = store.search_fts(query, limit=limit)
|
||||
fts_results = store.search_fts_exact(
|
||||
query, limit=limit, return_full_content=True
|
||||
)
|
||||
|
||||
# Optionally add semantic keyword results
|
||||
if include_semantic:
|
||||
|
||||
@@ -200,7 +200,9 @@ class HybridSearchEngine:
|
||||
"""
|
||||
try:
|
||||
with DirIndexStore(index_path) as store:
|
||||
return store.search_fts_exact(query, limit=limit)
|
||||
return store.search_fts_exact(
|
||||
query, limit=limit, return_full_content=True
|
||||
)
|
||||
except Exception as exc:
|
||||
self.logger.debug("Exact search error: %s", exc)
|
||||
return []
|
||||
@@ -220,7 +222,9 @@ class HybridSearchEngine:
|
||||
"""
|
||||
try:
|
||||
with DirIndexStore(index_path) as store:
|
||||
return store.search_fts_fuzzy(query, limit=limit)
|
||||
return store.search_fts_fuzzy(
|
||||
query, limit=limit, return_full_content=True
|
||||
)
|
||||
except Exception as exc:
|
||||
self.logger.debug("Fuzzy search error: %s", exc)
|
||||
return []
|
||||
|
||||
@@ -127,3 +127,18 @@ class LiteLLMEmbedderWrapper(BaseEmbedder):
|
||||
|
||||
# LiteLLM handles batching internally, ignore batch_size parameter
|
||||
return self._embedder.embed(texts)
|
||||
|
||||
def embed_single(self, text: str) -> list[float]:
|
||||
"""Generate embedding for a single text.
|
||||
|
||||
Args:
|
||||
text: Text to embed.
|
||||
|
||||
Returns:
|
||||
list[float]: Embedding vector as a list of floats.
|
||||
"""
|
||||
# Sanitize text before embedding
|
||||
sanitized = self._sanitize_text(text)
|
||||
embedding = self._embedder.embed([sanitized])
|
||||
return embedding[0].tolist()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user