lmlucene

lmlucene exposes Apache Lucene 10.5.2 indexing, full-text and KNN vector search, facets, and SAM analysis/scoring rules to LMScript programs.

Quick reference

lmscript install github:lmctl-ai/lmlucene@latest
lmlucene --version
lmlucene --lmcode-schema --json
lmlucene --lmcode-signatures
lmscript lmcode/examples/basic.lms
ItemKindPurpose
--lmcode FILE.dslbCLI flagExecute compiled lmcode bytecode against real Apache Lucene objects.
run --program FILE.dslb [--dryrun]SubcommandRun or dry-validate a compiled program via the cli.schema.v1 contract.
memory_directory / fs_directory / index_writerHost functionsCreate in-memory or persistent NIOFSDirectory Lucene indexes.
index_searcher / parse_query / knn_queryHost functionsRun full-text, Boolean, numeric range, facet drilldown, and KNN searches.
TokenTransform, FieldWeightSAM interfacesCustomize Lucene token normalization and BM25 per-field scoring weights.
RestGet..RestOptions, CliCommand, CliOptionSAM interfacesStandard lmcode_std_v3 REST and stateless CLI handler interfaces (current main; check --lmcode-signatures on a released host).
program = _lmcode_ cli="lmlucene" install="github:lmctl-ai/lmlucene@latest";
let directory = memory_directory();
let analyzer = standard_analyzer();
let writer = index_writer(directory, writer_config(analyzer));
writer.add(document().keyword("id", "1", true).text("body", "Hello Lucene", true));
let reader = writer.reader();
index_searcher(reader).search(term_query("body", "lucene"), 10).emit("matches");
end _lmcode_
r = run_lmcode(program);
assert(r.ok);

Documentation pages

Source repository and releases