public class

NearSpansUnordered

extends Spans
java.lang.Object
   ↳ org.apache.lucene.search.spans.Spans
     ↳ org.apache.lucene.search.spans.NearSpansUnordered

Class Overview

Similar to NearSpansOrdered, but for the unordered case. Expert: Only public for subclassing. Most implementations should not need this class

Summary

Public Constructors
NearSpansUnordered(SpanNearQuery query, IndexReader reader)
Public Methods
int doc()
Returns the document number of the current match.
int end()
Returns the end position of the current match.
Collection<byte[]> getPayload()
WARNING: The List is not necessarily in order of the the positions
Spans[] getSubSpans()
boolean isPayloadAvailable()
Checks if a payload can be loaded at this position.
boolean next()
Move to the next match, returning true iff any such exists.
boolean skipTo(int target)
Skips to the first match beyond the current, whose document number is greater than or equal to target.
int start()
Returns the start position of the current match.
String toString()
[Expand]
Inherited Methods
From class org.apache.lucene.search.spans.Spans
From class java.lang.Object

Public Constructors

public NearSpansUnordered (SpanNearQuery query, IndexReader reader)

Throws
IOException

Public Methods

public int doc ()

Returns the document number of the current match. Initially invalid.

public int end ()

Returns the end position of the current match. Initially invalid.

public Collection<byte[]> getPayload ()

WARNING: The List is not necessarily in order of the the positions

Returns
  • Collection of byte[] payloads
Throws
IOException

public Spans[] getSubSpans ()

public boolean isPayloadAvailable ()

Checks if a payload can be loaded at this position.

Payloads can only be loaded once per call to next().

Returns
  • true if there is a payload available at this position that can be loaded

public boolean next ()

Move to the next match, returning true iff any such exists.

Throws
IOException

public boolean skipTo (int target)

Skips to the first match beyond the current, whose document number is greater than or equal to target.

Returns true iff there is such a match.

Behaves as if written:

   boolean skipTo(int target) {
     do {
       if (!next())
 	     return false;
     } while (target > doc());
     return true;
   }
 
Most implementations are considerably more efficient than that.

Throws
IOException

public int start ()

Returns the start position of the current match. Initially invalid.

public String toString ()