public interface Doc
Modifier and Type | Method and Description |
---|---|
void |
characterOffsets(Field field,
int[] startsOfWords,
int[] endsOfWords,
boolean fillInDefaultsIfNotFound) |
default String |
contents()
Get the document contents (original XML).
|
default String |
contents(Field field)
Get the contents of a field from a Lucene Document.
|
String |
contents(Field field,
int startAtWord,
int endAtWord)
Get part of the contents of a field from a Lucene Document.
|
String |
contentsByCharPos(Field field,
int startAtChar,
int endAtChar)
Get part of the contents of a field from a Lucene Document.
|
boolean |
equals(Object obj) |
static Doc |
get(BlackLabIndex index,
int id) |
int |
hashCode() |
default String |
highlightContent(Hits hits)
Highlight field content with the specified hits.
|
String |
highlightContent(Hits hits,
int startAtWord,
int endAtWord)
Highlight part of field content with the specified hits,
and make sure it's well-formed.
|
int |
id() |
BlackLabIndex |
index() |
boolean |
isLuceneDocCached()
Have we loaded and cached the Lucene document?
|
org.apache.lucene.document.Document |
luceneDoc()
Retrieve a Lucene Document object from the index.
|
List<Concordance> |
makeConcordancesFromContentStore(Field field,
int[] startsOfWords,
int[] endsOfWords,
XmlHighlighter hl)
Determine the concordance strings for a number of concordances, given the
relevant character positions.
|
static Doc get(BlackLabIndex index, int id)
BlackLabIndex index()
LeafReader
or CompositeReader
)int id()
org.apache.lucene.document.Document luceneDoc()
docId
- the document idRuntimeException
- if the document doesn't exist (use maxDoc() and
isDeleted() to check first!)boolean isLuceneDocCached()
String contentsByCharPos(Field field, int startAtChar, int endAtChar)
field
- the fieldstartAtChar
- where to start getting the content (-1 for start of document, 0 for first char)endAtChar
- where to end getting the content (-1 for end of document)default String contents(Field field)
docId
- the Document idfield
- the fielddefault String contents()
docId
- the Document idString contents(Field field, int startAtWord, int endAtWord)
field
- the fieldstartAtWord
- where to start getting the content (-1 for start of document, 0 for first word)endAtWord
- where to end getting the content (-1 for end of document)String highlightContent(Hits hits, int startAtWord, int endAtWord)
hits
- the hitsstartAtWord
- where to start highlighting (first word returned)endAtWord
- where to end highlighting (first word not returned)default String highlightContent(Hits hits)
docId
- document to highlight a field fromhits
- the hitsvoid characterOffsets(Field field, int[] startsOfWords, int[] endsOfWords, boolean fillInDefaultsIfNotFound)
List<Concordance> makeConcordancesFromContentStore(Field field, int[] startsOfWords, int[] endsOfWords, XmlHighlighter hl)
doc
- the Lucene document numberfield
- the fieldstartsOfWords
- the array of starts of words ([A] and [B] positions)endsOfWords
- the array of ends of words ([C] and [D] positions)hl
- Copyright © 2020 Instituut voor Nederlandse Taal (INT). All rights reserved.