build_index_from_sources
build_index_from_sources
Build a complete search index from multiple source files and directories. This is the primary method for index construction. It handles file discovery, text extraction, chunking, embedding generation, and storage.
Parameters
sources
List of Path objects pointing to files and/or directories to index.
output_file
Output path for the .swsearch file (SQLite backend) or collection name (pgvector).
file_types
File extensions to include when scanning directories (e.g., ["md", "txt", "py"]).
exclude_patterns
Glob patterns for files to exclude (e.g., ["**/node_modules/**"]).
languages
List of language codes to support. Defaults to ["en"].
tags
Global tags to add to every chunk in the index.
overwrite
For the pgvector backend, drop and recreate the collection if it already exists.
Returns
None