For sparse indexes, QuackIR currently supports BM25 indexing in DuckDB and SQLite, and full text search indexing in PostgreSQL.
For dense indexes, QuackIR currently supports vector indexes DuckDB and PostgreSQL.
Using quackir.index directly loads the specified input into the specified table for the specified index type in the specified database, tokenizing the contents if the index is sparse unless otherwise indicated.
The appropriate database options must be provided. For more details, see this guide.
-
--input[Required]: Path to the file or folder containing data to index. Files must be in eitherjsonlorparquetformat. If the input is a directory, every file ending in.jsonlor.parquetis processed. Other files or subdirectories are skipped. If the file is injsonl, it is expected that it has the fieldsid, and the fieldcontentsif theindex-typeissparseor the fieldvectorif theindex-typeisdense. If the file is inparquet, it is expected that theindex-typeisdenseand that there are two columns in the file, the first being the id and the second being the vector with the keyvector. It follows that if the file is inparquetthedb-typecannot beSQLITE. After every successfully processed file, a message is printed with how many entries are currently in the index. -
--index-type[Required]: Type of index to create. Available options:sparse,dense. If the index-type issparse, a table with the columnsidandcontentsis created; and the input files cannot be inparquet. If the index-type isdense, a table with the columnsidandembeddingis created; and thedb-typecannot beSQLITE. -
--index: Name of the table to create. Default iscorpus. If a table with the same name currently exists, it is dropped. Any dashes are changed to underscores for better compatibility. This cleaning also occurs during search. -
--pretokenized: Indicates if the contents are pretokenized. Default isFalse, meaning the contents will be tokenized during indexing. Including this flag will turn off tokenizing during indexing. Not considered for dense indexes. -
--dimension: Dimension of the embedding vector. Default is 768. Not considered for sparse indexes.