Yes it is safe. This is the lucene's logic.

DIGY

-----Original Message-----
From: Trevor Watson [mailto:[email protected]] 
Sent: Friday, January 27, 2012 11:59 PM
To: [email protected]
Subject: [Lucene.Net] reader.Terms order

Hello!

We populate a list of terms that users can filter with prefixes. (they 
type in a text box and as they type the list gets filtered).

I was curious, when using reader.Terms(), is there a specific order the 
terms come out in?

the code we use for it is
terms = reader.Terms(new Lucene.Net.Index.Term(fieldName, sPrefix))


The terms seem to be sorted alphabetically by field, so if we run past 
the end of the prefix or the end of the field, is it safe to believe 
that a term farther down the list won't match the field/prefix combination?


-----

Checked by AVG - www.avg.com
Version: 2012.0.1901 / Virus Database: 2109/4770 - Release Date: 01/27/12

Reply via email to