Re: Best practice to map Lucene docids to real ids

2014-05-06 Thread Michael McCandless
Doc values is far faster than a stored field. If the default DocValuesFormat isn't fast enough, you can always switch to e.g. DirectDocValuesFormat (uses lots of RAM but it just an array lookup). Mike McCandless http://blog.mikemccandless.com On Tue, May 6, 2014 at 4:33 AM, Sven Teichmann wro

Re: Best practice to map Lucene docids to real ids

2014-05-06 Thread Wouter Heijke
Hi, I would index it in a field, you can use the database id and even add additional information so compose your own key and retrieve that (only) when you collect search results. Wouter > Hi, > > what is the best way to retrieve our "real" ids (as they are in our > database) while searching? > >

Re:Best practice to map Lucene docids to real ids

2014-05-06 Thread 308181687
Why not add an LongField to store the real id, and retrieve it directly by Document.get('real id field name'). lubin -- Original -- From: "Sven Teichmann";; Date: Tue, May 6, 2014 04:33 PM To: "java-user"; Subject: Best practice to map Lucene docids to re

Aw: RE: 回复: Never close IndexWriter/Reader?

2014-05-06 Thread Sascha Janz
Hello, many thanks to your answers. i modified our sources to leave the IndexWriter open. Also we changed the commit strategy. may be we will do commit only at night. We used to create own IndexReader for search. Now we changed this using SearcherManager which performs quite well. We have

Best practice to map Lucene docids to real ids

2014-05-06 Thread Sven Teichmann
Hi, what is the best way to retrieve our "real" ids (as they are in our database) while searching? Right now we generate a file after indexing which contains all Lucene docids and the matching id in our database. Our own Collector converts the docids to our ids while collecting. This works a