This library offers a JavaScript implementation of the Lucene query parser, allowing applications to translate Lucene-style query strings into an Abstract Syntax Tree (AST). It was developed using PEG.js, a parser generator. The current stable version is 1.2.0, which was released in 2017. The project appears to be abandoned, with no significant updates or commits in several years. Its key differentiator is providing a direct JavaScript port of the Lucene query parsing logic, enabling both client-side and server-side (Node.js) applications to interpret complex search queries adhering to Lucene syntax. Users should be aware of its inactive development status and potential compatibility challenges with modern JavaScript ecosystems, especially concerning ES Modules (ESM) or newer Node.js features, as it predates widespread adoption of these standards.
npm install lucene-query-parserVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to parse simple and grouped Lucene query strings into an AST and access the parsed components.
Consider forking the repository and updating its dependencies, or migrating to a more actively maintained Lucene parser if long-term support is required.
For Node.js, ensure your project is configured for CJS, or use dynamic `import()` if ESM is necessary. For browser, use the provided AMD module with RequireJS or bundle it using a tool like Webpack/Rollup that can handle CJS modules.
Manually create a declaration file (`lucene-query-parser.d.ts`) to provide types for the parsed AST structure, or cast the parser's output to `any`.
Change your file to a CommonJS context (e.g., rename to `.js` if `type: module` is not set, or ensure it's not an `.mjs` file). Alternatively, use `import parser from 'lucene-query-parser';` if your bundler supports transpiling CJS to ESM, or `const parser = await import('lucene-query-parser');` for dynamic import.Run `npm install lucene-query-parser` to install the package. Ensure the `require` statement uses the correct package name.
No dependency data recorded yet.