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
| Item | Kind | Purpose |
|---|---|---|
| --lmcode FILE.dslb | CLI flag | Execute compiled lmcode bytecode against real Apache Lucene objects. |
| run --program FILE.dslb [--dryrun] | Subcommand | Run or dry-validate a compiled program via the cli.schema.v1 contract. |
| memory_directory / fs_directory / index_writer | Host functions | Create in-memory or persistent NIOFSDirectory Lucene indexes. |
| index_searcher / parse_query / knn_query | Host functions | Run full-text, Boolean, numeric range, facet drilldown, and KNN searches. |
| TokenTransform, FieldWeight | SAM interfaces | Customize Lucene token normalization and BM25 per-field scoring weights. |
| RestGet..RestOptions, CliCommand, CliOption | SAM interfaces | Standard 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);