The Id and Phone fields are stored.  So I can just do a MatchAllQuery as you 
suggested.  I have read about field selectors on this mailing list but have 
never used it.  Does anyone know where I can find some sample code? Thank you.

> Date: Sat, 22 Mar 2008 16:03:54 -0700
> From: [EMAIL PROTECTED]
> To: java-user@lucene.apache.org
> Subject: RE: Field values ...
> 
> 
> : 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]
> 

_________________________________________________________________
Test your Star IQ
http://club.live.com/red_carpet_reveal.aspx?icid=redcarpet_HMTAGMAR

Reply via email to