yyyyMMddHHmmssSSS
or shorter,
depeding on resolution
yyyyMMddHHmmssSSS
or shorter,
depeding on resolution
; using UTC as timezone
timeToString
or
DateToString
back to a time, represented as the
number of milliseconds since January 1, 1970, 00:00:00 GMT.
dateString
is not in the timeToString
or
DateToString
back to a time, represented as a
Date object.
dateString
is not in the 2004-09-21 13:50:11
will be changed to 2004-09-01 00:00:00
when using
Resolution.MONTH
.
resolution
set to 0 or 1
1095767411000
(which represents 2004-09-21 13:50:11) will be changed to
1093989600000
(2004-09-01 00:00:00) when using
Resolution.MONTH
.
resolution
set to 0 or 1, expressed as milliseconds since January 1, 1970, 00:00:00 GMT
Adds a field to a document. Several fields may be added with the same name. In this case, if the fields are indexed, their text is treated as though appended for the purposes of search.
Note that add like the removeField(s) methods only makes sense prior to adding a document to an index. These methods cannot be used to change the content of an existing index! In order to achieve this, a document has to be deleted from an index and a new changed version of that document has to be added.
Removes field with the specified name from the document. If multiple fields exist with this name, this method removes the first field that has been added. If there is no field with the specified name, the document remains unchanged.
Note that the removeField(s) methods like the add method only make sense prior to adding a document to an index. These methods cannot be used to change the content of an existing index! In order to achieve this, a document has to be deleted from an index and a new changed version of that document has to be added.
Removes all fields with the given name from the document. If there is no field with the specified name, the document remains unchanged.
Note that the removeField(s) methods like the add method only make sense prior to adding a document to an index. These methods cannot be used to change the content of an existing index! In order to achieve this, a document has to be deleted from an index and a new changed version of that document has to be added.
null
.
Field[]
array
null
.
String[]
of field values
null
if no
binary fields with the specified name are available.
byte[][]
of binary field values.
null
if no binary fields with the specified name are available.
There may be non-binary fields with the same name.
byte[]
containing the binary field value.
value
should be stored in the index
Whether the field should be indexed, and if so, if it should
be tokenized before indexing
null
value
should be stored in the index
Whether the field should be indexed, and if so, if it should
be tokenized before indexing
Whether term vector should be stored
null
TermVector.YES
null
null
value
should be stored (compressed or not.)
Store.NO
stored
attribute instead.
dir
or name
is null file
is the string by which the
sub-stream will be known in the compound stream.
file
is null FilterIndexReader
contains another IndexReader, which it
uses as its basic source of data, possibly transforming the data along the
way or providing additional functionality. The class
FilterIndexReader
itself simply implements all abstract methods
of IndexReader
with versions that pass all requests to the
contained index reader. Subclasses of FilterIndexReader
may
further override some of these methods and may also provide additional
methods and fields.
true
if an index exists at the specified directory.
If the directory does not exist or if there is no index in it.
false
is returned.
true
if an index exists; false
otherwise
true
if an index exists at the specified directory.
If the directory does not exist or if there is no index in it.
true
if an index exists; false
otherwise
true
if an index exists at the specified directory.
If the directory does not exist or if there is no index in it.
true
if an index exists; false
otherwise
n
th
Document
in this index.
t
. docNum
. Once a document is
deleted it will not appear in TermDocs or TermPostitions enumerations.
Attempts to read its field with the {@link #document}
method will result in an error. The presence of this document may still be
reflected in the {@link #docFreq} statistic, though
this will be corrected eventually as the index is further modified.
docNum
.
Applications should call {@link #DeleteDocument(int)} or {@link #DeleteDocuments(Term)}.
term
.
This is useful if one uses a document field to hold a unique ID string for
the document. Then to delete such a document, one merely constructs a
term with the appropriate field and the unique ID string as its text and
passes it to this method.
See {@link #Delete(int)} for information about when this deletion will
become effective.
true
iff the index in the named directory is
currently locked.
true
iff the index in the named directory is
currently locked.
Construct a FilterIndexReader based on the specified base reader. Directory locking for delete, undeleteAll, and setNorm operations is left to the base reader.
Note that base reader is closed if this FilterIndexReader is closed.
.f
+ a number.
Also note that two of Lucene's files (deletable
and
segments
) don't have any filename extension.
true
to create the index or overwrite the existing one;
false
to append to the existing index
true
to create the index or overwrite the existing one;
false
to append to the existing index
true
to create the index or overwrite the existing one;
false
to append to the existing index
term
.
This is useful if one uses a document field to hold a unique ID string for
the document. Then to delete such a document, one merely constructs a
term with the appropriate field and the unique ID string as its text and
passes it to this method. Returns the number of documents deleted.
docNum
.numUniqueTerms/interval
terms are read into
memory by an IndexReader, and, on average, interval/2
terms
must be scanned for each random term access.
path
.
Text will be analyzed with a
. If create
is true, then a new, empty index will be created in
path
, replacing the index already there, if any.
true
to create the index or overwrite
the existing one; false
to append to the existing
index
create
is
false
path
.
Text will be analyzed with a
. If create
is true, then a new, empty index will be created in
path
, replacing the index already there, if any.
true
to create the index or overwrite
the existing one; false
to append to the existing
index
create
is
false
d
.
Text will be analyzed with a
. If create
is true, then a new, empty index will be created in
d
, replacing the index already there, if any.
true
to create the index or overwrite
the existing one; false
to append to the existing
index
create
is
false
After this completes, the index is optimized.
The provided IndexReaders are not closed.
MultipleTermPositions
here.
MultipleTermPositions
instance.
{ pq.top().change(); pq.adjustTop(); }instead of
{ o = pq.pop(); o.change(); pq.push(o); }
Construct a MultiReader aggregating the named set of (sub)readers. Directory locking for delete, undeleteAll, and setNorm operations is left to the subreaders.
Note that all subreaders are closed if this Multireader is closed.
smis
contains segments that are positioned at the same term. N
is the number of cells in the array actually occupied.
getTerms
method. Each location in the array contains the number of times this
term occurs in the document or the document field.
getTerms
at which the term with the specified
term
appears. If this term does not appear in the array,
return -1.
indexOf(int)
but searches for a number of terms
at the same time. Returns an array that has the same size as the number
of terms searched for, each slot containing the result of searching for
that term number.
TermFreqVector
to provide additional information about
positions in which each of the terms is found. A TermPositionVector not necessarily
contains both positions and offsets, but at least one of these arrays exists.
indexOf
method.
May return null if positions have not been stored.
indexOf
method.
for each document
{
writer.openDocument();
for each field on the document
{
writer.openField(field);
for all of the terms
{
writer.addTerm(...)
}
writer.closeField
}
writer.closeDocument()
}
OR_OPERATOR
) terms without any modifiers
are considered optional: for example capital of Hungary
is equal to
capital OR of OR Hungary
.AND_OPERATOR
mode terms are considered to be in conjuction: the
above mentioned query is parsed as capital AND of AND Hungary
true
.
\
.
It will, when parse(String query)
is called, construct a query like this (assuming the query consists of
two terms and you specify the two fields title
and body
):
(title:term1 body:term1) (title:term2 body:term2)
When setDefaultOperator(AND_OPERATOR) is set, the result will be:
+(title:term1 body:term1) +(title:term2 body:term2)
In other words, all the query's terms must appear, but it doesn't matter in what fields they appear.
b
. Documents
matching this clause will (in addition to the normal weightings) have
their score multiplied by b
.
b
. The boost is 1.0 by default.
match
whose end
position is less than or equal to end
.
slop
total unmatched positions between
them. * When inOrder
is true, the spans from each clause
must be * ordered as in clauses
.
o
is equal to this. include
which
have no overlap with spans from exclude
.
o
is equal to this. Similarity
implementation used by this scorer.
o
is equal to this. o
is equal to this. SHOULD
subqueries, at least one of the queries must appear in the matching documents.
MUST_NOT
query.
By default no optional clauses are neccessary for a match (unless there are no required clauses). If this method is used, then the specified numebr of clauses is required.
Use of this method is totally independant of specifying that any specific clauses are required (or prohibited). This number will only be compared against the number of matching optional clauses.
EXPERT NOTE: Using this method will force the use of BooleanWeight2, regardless of wether setUseScorer14(true) has been called.
o
is equal to this. ConjunctionScorer
.
This Scorer implements {@link Scorer#SkipTo(int)} and uses skipTo() on the given Scorers.
DisjunctionScorer
, using one as the minimum number
of matching subscorers.
scorerQueue
.
PriorityQueue
that orders by {@link Scorer#Doc()}. o
is equal to this. true
if the lower endpoint is inclusive true
if the upper endpoint is inclusive o
is equal to this. 1/sqrt(numTerms)
. 1/sqrt(sumOfSquaredWeights)
. sqrt(freq)
. 1 / (distance + 1)
. log(numDocs/(docFreq+1)) + 1
. overlap / maxOverlap
. field
as integers and returns an array
of size reader.maxDoc()
of the value each document
has in the given field.
field
as integers and returns an array of
size reader.maxDoc()
of the value each document has in the
given field.
field
as floats and returns an array
of size reader.maxDoc()
of the value each document
has in the given field.
field
as floats and returns an array
of size reader.maxDoc()
of the value each document
has in the given field.
field
and returns an array
of size reader.maxDoc()
containing the value each document
has in the given field.
field
and returns
an array of them in natural order, along with an array telling
which element in the term array each document uses.
field
to see if it contains integers, floats
or strings, and then calls one of the other methods in this class to get the
values. For string values, a StringIndex is returned. After
calling this method, there is an entry in the cache for both
type AUTO
and the actual found type.
field
and calls the given SortComparator
to get the sort values. A hit in the cache will happen if reader
,
field
, and comparator
are the same (using equals()
)
as a previous call to this method.
null
.
This is to handle the case using ParallelMultiSearcher where the
original list contains AUTO and we don't know the actual sort
type until the values come back. The fields can only be set once.
This method is thread safe.
null
. The collators
correspond to any SortFields which were given a specific locale.
null
.
a
is less relevant than b
.true
if document a
should be sorted after document b
.
null
or empty.
The number of hits to retain. Must be greater than zero.
a
is less relevant than b
.true
if document a
should be sorted after document b
.
SortField.SCORE
, SortField.DOC
, SortField.STRING
, SortField.INTEGER
,
SortField.FLOAT
or SortField.CUSTOM
. It is not valid to return SortField.AUTO
.
This is used by multisearchers to determine how to collate results from their searchers.
null
.
Filter to apply to query results, cannot be null
.
o
is equal to this. term
. minimumSimilarity
to term
.
If a prefixLength
> 0 is specified, a common prefix
of that length is also required.
minimumSimilarity
of 0.5
a term of the same length
as the query term is considered similar to the query term if the edit distance
between both terms is less than length(term)*0.5
length of common (non-fuzzy) prefix
min
has been retrieved.
Caution: Iterate only over the hits needed. Iterating over all hits is generally not desirable and may be the source of performance issues.
term
.
Called by search code to compute term weights.
term
. Returns an array with these
document frequencies. Used to minimize number of remote calls.
i
.
Called by {@link HitCollector} implementations.
query
. query
and
filter
.
query
sorted by
sort
.
query
and filter
,
sorted by sort
.
query
o
is equal to this. n
in the array
used to construct this searcher.
n
within its
sub-index.
o
is equal to this. app*
.
prefix
. o
is equal to this. query
.
This code borrows heavily from {@link RangeQuery}, but is implemented as a Filter
fieldName
matching
less than or equal to upperTerm
.
fieldName
matching
greater than or equal to lowerTerm
.
o
is equal to this. [010 TO 120]
.
lowerTerm
but less than upperTerm
.
There must be at least one term and either term may be null,
in which case there is no bound on that side, but if there are
two terms, both terms must be for the same field.
true
if the range query is inclusive o
is equal to this. ReqExclScorer
.ReqOptScorer
.field
then by index order (document
number). The type of value in field
is determined
automatically.
field
then by
index order (document number). The type of value in field
is
determined automatically.
field
is determined automatically.
field
then by index order
(document number).
field
possibly in reverse,
then by index order (document number).
null
.
null
.
True if natural order should be reversed.
null
if
type
is SCORE or DOC.
Type of values in the terms.
null
if
type
is SCORE or DOC.
Type of values in the terms.
True if natural order should be reversed.
null
.
Locale of values in the field.
null
.
Locale of values in the field.
null
.
Returns a comparator for sorting hits.
null
.
Returns a comparator for sorting hits.
True if natural order should be reversed.
null
if the sort is by SCORE or DOC.
null
.
null
if no Locale was specified.
null
.
t
. o
is equal to this. Scorer
for documents matching a Term
.TermScorer
. *
, which
matches any character sequence (including the empty one), and ?
,
which matches any single character. Note this query can be slow, as it
needs to iterate over many terms. In order to prevent extremely slow WildcardQueries,
a Wildcard term should not start with one of the wildcards *
or
?
.
Lucene.Net.lockDir
or java.io.tmpdir
system property
Lock
holding the lock
RAMDirectory
instance from the {@link FSDirectory}.
File
specifying the index directory
RAMDirectory
instance from the {@link FSDirectory}.
String
specifying the full index directory path
n
bits. bit
to one. bit
to zero. true
if bit
is one and
false
if it is zero.
name
in Directory
d
, in a format that can be read by the constructor {@link
#BitVector(Directory, String)}.
name
in Directory
d
, as written by the {@link #write} method.