# @types/lucene

> TypeScript definitions for lucene

Latest version **2.1.7** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/lucene
pnpm add @types/lucene
yarn add @types/lucene
bun add @types/lucene
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.1.7 |
| Published | 2023-11-07 |
| First published | 2019-11-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51449 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/lucene
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lucene
- npm.io page: https://npm.io/package/@types/lucene

## Recent versions

- 2.1.7 (latest) — 2023-11-07
- 2.1.5 (ts4.3) — 2023-08-30
- 2.1.4 (ts3.8) — 2021-12-06
- 2.1.3 (ts3.6) — 2021-07-08
- 2.1.2 (ts3.2) — 2020-10-16
- 2.1.1 (ts2.8) — 2020-03-18
- 2.1.0 (ts2.0) — 2019-11-05
- 2.1.6 — 2023-10-18

## README

# Installation
> `npm install --save @types/lucene`

# Summary
This package contains type definitions for lucene (https://github.com/bripkens/lucene#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lucene.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lucene/index.d.ts)
````ts
export interface TermLocation {
    column: number;
    line: number;
    offset: number;
}

export interface NodeField {
    field: string | "<implicit>";
    fieldLocation: null | {
        end: TermLocation;
        start: TermLocation;
    };
}

export interface NodeTerm extends NodeField {
    boost: null | number;
    prefix: null | string;
    quoted: boolean;
    regex: boolean;
    similarity: null | number;
    term: string;
    termLocation: {
        start: TermLocation;
        end: TermLocation;
    };
}

export interface NodeRangedTerm extends NodeField {
    inclusive: "both" | "none" | "left" | "right";
    term_max: string;
    term_min: string;
}

export type Node =
    | NodeTerm
    | NodeRangedTerm;

export type Operator = "<implicit>" | "NOT" | "OR" | "AND" | "AND NOT" | "OR NOT";

export interface ASTField {
    field?: string;
    fieldLocation?: null | {
        end: TermLocation;
        start: TermLocation;
    };
    parenthesized?: boolean;
}

export interface LeftOnlyAST extends ASTField {
    left: AST | Node;
    start?: Operator | undefined;
}

export interface BinaryAST extends ASTField {
    left: AST | Node;
    operator: Operator;
    right: AST | Node;
}

export type AST = LeftOnlyAST | BinaryAST;

export function parse(query: string): AST;

export function toString(ast: AST): string;

export interface Parser {
    escape(str: string): string;
    unescape(str: string): string;
}

export const term: Parser;
export const phrase: Parser;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [Ben Grynhaus](https://github.com/bengry), and [Hugo Muller](https://github.com/HugoMuller).

---
_Source: https://npm.io/package/@types/lucene · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
