Re: Simple Filter-Question

2007-12-30 Thread Daniel Naber
On Sonntag, 30. Dezember 2007, Dominik Bruhn wrote: > I know this is the wrong approach and that the right solution should be > a Filter. But I dont know which filter to use and how. The simplest approach is probably to wrap your limiting query with this class: http://lucene.apache.org/java/2_2

Re: Prioiritze new documents

2007-12-30 Thread Dominik Bruhn
Hy, a solution came into my mind: Every document gets boosted by a integer which I increment each time I add a new document to the index. So the newer documents should get a bigger boost than the older ones. I tried it out and ran into a problem: Although I set the Boost via doc.setBoost(value)

Re: Prioiritze new documents

2007-12-30 Thread Daniel Naber
On Sonntag, 30. Dezember 2007, Dominik Bruhn wrote: > Although I set the Boost via doc.setBoost(value) for each document > before writing it to the index it doesnt change anything. Even worse if > I look at the index using Luke (Version 0.7.1) each document got a boost > of 1 not of the value supp

Re: Prioiritze new documents

2007-12-30 Thread Dominik Bruhn
On Sun, Dec 30, 2007 at 02:08:37PM +0100, Daniel Naber wrote: > From the Javadoc of getBoost(): > > Note: This value is not stored directly with the document in the index. > Documents returned from IndexReader.document(int) and Hits.doc(int) may > thus not have the same value present as when thi

Re: Prioiritze new documents

2007-12-30 Thread Daniel Naber
On Sonntag, 30. Dezember 2007, Dominik Bruhn wrote: > I already know this, but ALL documents got a bost of 1. The values > should a least differ some how, shouldnt they? Yes, it looks like a bug, at least in the javadoc. In FieldsReader, the document is created but setBoost() is never called. So

Re: Prioiritze new documents

2007-12-30 Thread Dominik Bruhn
On Sun, Dec 30, 2007 at 02:32:14PM +0100, Daniel Naber wrote: > Yes, it looks like a bug, at least in the javadoc. In FieldsReader, the > document is created but setBoost() is never called. So calling getBoost is > like calling get("field") on a field that isn't stored. Could you open an > issue

Re: Prioiritze new documents

2007-12-30 Thread Grant Ingersoll
I think it is the case that Luke doesn't show the boosts, see http://www.gossamer-threads.com/lists/lucene/java-user/32020?search_string=Luke%20boost%201;#32020 On Dec 30, 2007, at 7:38 AM, Dominik Bruhn wrote: Hy, a solution came into my mind: Every document gets boosted by a integer which I