Class | Ferret::Search::Spans::SpanFirstQuery |
In: |
ext/r_search.c
|
Parent: | Ferret::Search::Query |
A SpanFirstQuery resticts 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.
To find all documents where "ferret" is within the first 100 characters (really bytes);
query = SpanFirstQuery.new(SpanTermQuery.new(:content, "ferret"), 100)
SpanFirstQuery only works with other SpanQueries.
Create a new SpanFirstQuery which matches all documents where span_query matches before end where end is a byte-offset from the start of the field