You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Samuel Edge <sa...@edges.org> on 2006/01/30 05:25:51 UTC

Possible new use for term dictionary... (maybe)

I would like to use Lucene's term dictionary as a randomly addressable,
lexically sorted repository.  A mouthful I know.... I want to be able to
access terms as if I had loaded all terms using IndexReader.terms(context);
iterating all terms and storing their text sequentially, in sorted order, in
a Vector collection.  But instead of using the vector loading approach, I
want to reference the index terms where they exist in the dictionary and
individually reference them by their position, (TermInfosReader.get(int
position)  leads me to believe this might be possible).  The primary need
for this arises where I have a virtual listbox and I have thousands upon
thousands of terms that I need to load into the lisbox.  A standard listbox
is usually populated by accepting literal strings items - this works but is
slow, slow, slow.  A virtual listbox allows me to define the existence of
1,000,000 items, but without pre-loading the items; when it is time to show
a slice of the1,000,000 items, a request is sent to me to return strings
items for a range of positions.

 

>From above, I have the following questions:  1) Does the dictionary truly
contain the terms in sorted order ?   2) Has this random/position term issue
already been solved?  3) is TermInfosReader the right approach? It's use
seems to involve internal, non-public APIs - any suggestions on its use ?
3) I am using the Lucene compound file format rather than multifile; I've
looked at  TermInfosReader and it appears to work with multfile indexes
only.  Is this true?

 

Your help is truly appreciated!

 

Regards, Sam.