lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dragon Fly <dragon-fly...@hotmail.com>
Subject RE: Field values ...
Date Mon, 24 Mar 2008 12:12:58 GMT
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: hossman_lucene@fucit.org
> 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: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 

_________________________________________________________________
Test your Star IQ
http://club.live.com/red_carpet_reveal.aspx?icid=redcarpet_HMTAGMAR
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message