Re: Simple Filter-Question
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_0/api/org/apache/lucene/search/QueryWrapperFilter.html Then use that filter by calling an IndexSearcher.search() method that also takes a filter. Regards Daniel -- http://www.danielnaber.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prioiritze new documents
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) 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 supplied. Who can help me? Thanks -- Dominik Bruhn mailto: [EMAIL PROTECTED] signature.asc Description: Digital signature
Re: Prioiritze new documents
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 supplied. 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 this document was indexed. Regards Daniel -- http://www.danielnaber.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prioiritze new documents
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 this document was indexed. I already know this, but ALL documents got a bost of 1. The values should a least differ some how, shouldnt they? Thanks! -- Dominik Bruhn mailto: [EMAIL PROTECTED] signature.asc Description: Digital signature
Re: Prioiritze new documents
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 calling getBoost is like calling get("field") on a field that isn't stored. Could you open an issue for this? Regards Daniel -- http://www.danielnaber.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prioiritze new documents
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 for this? As I dont understand the bug or the problem you are pointing at I dont think I can ope a bugreport. Regards -- Dominik Bruhn mailto: [EMAIL PROTECTED] signature.asc Description: Digital signature
Re: Prioiritze new documents
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 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) 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 supplied. Who can help me? Thanks -- Dominik Bruhn mailto: [EMAIL PROTECTED] -- Grant Ingersoll http://lucene.grantingersoll.com http://www.lucenebootcamp.com Lucene Helpful Hints: http://wiki.apache.org/lucene-java/BasicsOfPerformance http://wiki.apache.org/lucene-java/LuceneFAQ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]