public final class FTIndex extends Object implements Index
This class provides access to a fuzzy full-text index structure
stored on disk. Each token has an entry in sizes, saving its length and a
pointer on ftdata, where to find the token and its ftdata.
The three database index files start with the prefix
DataText.DATAFTX
and have the following format:
[l, p] ...
l
is the length of a token [byte].p
is the pointer of the first token with length l
[int].
[t0, t1, ... tl, z, s]
t0, t1, ... tl-1
is the token [byte[l]]z
is the pointer on the data entries of the token [long]s
is the number of pre values, saved in data [int]
id/pos
references.
The values are ordered, but not distinct:pre1/pos1, pre2/pos2, pre3/pos3, ...
[Num
]Constructor and Description |
---|
FTIndex(Data d)
Constructor, initializing the index structure.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the index.
|
int |
costs(IndexToken it)
Returns a cost estimation for searching the specified token.
|
boolean |
drop()
Drops the index.
|
EntryIterator |
entries(IndexEntries entries)
Returns all entries that match the specified token.
|
byte[] |
info(MainOptions options)
Returns information on the index structure.
|
void |
init()
Initializes the index.
|
IndexIterator |
iter(IndexToken it)
Returns an iterator for the index results.
|
public FTIndex(Data d) throws IOException
d
- data referenceIOException
- I/O Exceptionpublic void init()
Index
public int costs(IndexToken it)
Index
public IndexIterator iter(IndexToken it)
Index
public EntryIterator entries(IndexEntries entries)
Index
public byte[] info(MainOptions options)
Index
public boolean drop()
Index
Copyright © 2005–2015 BaseX Team. All rights reserved.