You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by Trevor Watson <tw...@datassimilate.com> on 2012/01/27 22:59:19 UTC

[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?



RE: [Lucene.Net] reader.Terms order

Posted by Digy <di...@gmail.com>.
Yes it is safe. This is the lucene's logic.

DIGY

-----Original Message-----
From: Trevor Watson [mailto:twatson@datassimilate.com] 
Sent: Friday, January 27, 2012 11:59 PM
To: lucene-net-user@lucene.apache.org
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