: I want to do something like:
:
: List<Info> infoList = new ArrayList<Info> ();
: foreach (Document doc in LuceneIndex)
: {
: String id = doc.get ("Id");
: String phone = doc.get ("Phone");
: infoList.add (new Info (id, phone));
: }
If "Id" and "Phone" are stored values then that code will pretty much work
as is ... jut change "Document doc in LuceneIndex" to be something that
does a MtchAllQuery (putting your code in a HitCollector would probably be
pretty straight forward.
But it won't neccessarily be very efficient, particularly if you've got a
lot of other stored fields, but a FieldSelector can help make it faster.
if Id and Phone are both indexed fields, and ever doc has only one value
for each then you can use the FieldCache to get an array for each of them,
and then just iterate over the arrays in parallel (watch out for deleted
documents)
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]