lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Digy" <>
Subject RE: [Lucene.Net] reader.Terms order
Date Fri, 27 Jan 2012 23:14:29 GMT
Yes it is safe. This is the lucene's logic.


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


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 -
Version: 2012.0.1901 / Virus Database: 2109/4770 - Release Date: 01/27/12

View raw message