Class: Ferret::Search::Spans::SpanFirstQuery

Inherits:
Object
  • Object
show all
Defined in:
ext/r_search.c

Overview

Summary

A SpanFirstQuery restricts a query to search in the first end bytes of a field. This is useful since often the most important information in a document is at the start of the document.

Example

To find all documents where “ferret” is within the first 100 characters (really bytes);

query = SpanFirstQuery.new(SpanTermQuery.new(:content, "ferret"), 100)

NOTE

SpanFirstQuery only works with other SpanQueries.