createIndex

public final static Query createIndex(Document document)

Build a over any document, regardless of its source format. The document is converted to layout-preserving plain text in memory with the SDK's (page-boundary markers forced on, then restored) and tokenized + ranked once. Then call on the returned Query as many times as you like — each query skips this conversion and build. The Query captures the document's settings and is independent of it, so the document may be closed once the Query is built. Hits are reported by their original document page plus an approximate within-page line.

Parameters

document

An open document of any supported input format. Its (the group plus Markdown settings) drives the conversion and later queries — configure it on the document (e.g. via Document.Open(path, settings)).


public final static Query createIndex(String input, DocumentSettings settings)

Build a from a file path — a text/Markdown (.md/.txt) file, a directory of them (searched as one attributed corpus), or a prebuilt index. Any other file is rejected (open other formats as a and use ). Then call on the returned Query. A prebuilt index built from a document keeps its page provenance; plain text reports line ranges.

Parameters

input

Path to a UTF-8 text/Markdown (.md/.txt) file, a directory of them, or a prebuilt index file.

settings

Document settings; its group (algorithm, language, emit-index) drives the build and is captured for the Query's later searches.