lucene
This is the standard Aussom-Lang Lucene module. This module provides full-text indexing and search capabilities based on Apache Lucene v10.4.0, which is actively maintained and released under the Apache 2.0 license.
It provides two index types: an in-memory index for fast ephemeral indexing within a single session, and a file-system-backed index that persists across sessions. Plain text and Markdown files are supported, with Markdown syntax stripped before indexing.
Usage
Here's a short example, please see the API doc for details.
// Create an in-memory index.
idx = new luceneMemoryIndex();
idx.create();
// Add files to the index.
idx.addTextFile('/path/to/doc.txt');
idx.addMarkdownFile('/path/to/doc.md');
// Commit before searching.
idx.commit();
// Search the index.
results = idx.search('keyword');
foreach (r in results) {
c.log(r['path'] + ' (score=' + r['score'] + ')');
c.log(' ' + r['snippet']);
}
// Close the index.
idx.close();
License
Copyright 2026 Austin Lehman
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.