Class NearSpansOrdered
A Spans that is formed from the ordered subspans of a SpanNearQuery where the subspans do not overlap and have a maximum slop between them.
The formed spans only contains minimum slop matches.
The matching slop is computed from the distance(s) between the non overlapping matching Spans.
Successive matches are always formed from the successive Spans of the SpanNearQuery.
The formed spans may contain overlaps when the slop is at least 1.
For example, when querying using
t1 t2 t3
with slop at least 1, the fragment:
t1 t2 t1 t3 t2 t3
matches twice:
t1 t2 .. t3
t1 .. t2 t3
Expert: Only public for subclassing. Most implementations should not need this class
Namespace: Lucene.Net.Search.Spans
Assembly: Lucene.Net.dll
Syntax
public class NearSpansOrdered : Spans
Constructors
| Improve this Doc View SourceNearSpansOrdered(SpanNearQuery, AtomicReaderContext, IBits, IDictionary<Term, TermContext>)
Declaration
public NearSpansOrdered(SpanNearQuery spanNearQuery, AtomicReaderContext context, IBits acceptDocs, IDictionary<Term, TermContext> termContexts)
Parameters
Type | Name | Description |
---|---|---|
SpanNearQuery | spanNearQuery | |
AtomicReaderContext | context | |
IBits | acceptDocs | |
IDictionary<Term, TermContext> | termContexts |
NearSpansOrdered(SpanNearQuery, AtomicReaderContext, IBits, IDictionary<Term, TermContext>, Boolean)
Declaration
public NearSpansOrdered(SpanNearQuery spanNearQuery, AtomicReaderContext context, IBits acceptDocs, IDictionary<Term, TermContext> termContexts, bool collectPayloads)
Parameters
Type | Name | Description |
---|---|---|
SpanNearQuery | spanNearQuery | |
AtomicReaderContext | context | |
IBits | acceptDocs | |
IDictionary<Term, TermContext> | termContexts | |
System.Boolean | collectPayloads |
Properties
| Improve this Doc View SourceDoc
Returns the document number of the current match. Initially invalid.
Declaration
public override int Doc { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
| Improve this Doc View SourceEnd
Returns the end position of the current match. Initially invalid.
Declaration
public override int End { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
| Improve this Doc View SourceIsPayloadAvailable
Declaration
public override bool IsPayloadAvailable { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceStart
Returns the start position of the current match. Initially invalid.
Declaration
public override int Start { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
| Improve this Doc View SourceSubSpans
Declaration
public virtual Spans[] SubSpans { get; }
Property Value
Type | Description |
---|---|
Spans[] |
Methods
| Improve this Doc View SourceGetCost()
Declaration
public override long GetCost()
Returns
Type | Description |
---|---|
System.Int64 |
Overrides
| Improve this Doc View SourceGetPayload()
Declaration
public override ICollection<byte[]> GetPayload()
Returns
Type | Description |
---|---|
ICollection<System.Byte[]> |
Overrides
| Improve this Doc View SourceNext()
Move to the next match, returning true iff any such exists.
Declaration
public override bool Next()
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceSkipTo(Int32)
Skips to the first match beyond the current, whose document number is greater than or equal to target.
The behavior of this method is undefined when called with
target <= current
, or after the iterator has exhausted.
Both cases may result in unpredicted behavior.
Returns true
if there is such
a match.
Behaves as if written:
bool SkipTo(int target)
{
do
{
if (!Next())
return false;
} while (target > Doc);
return true;
}
Most implementations are considerably more efficient than that.
Declaration
public override bool SkipTo(int target)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | target |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |