Grokbase Groups Lucene dev May 2002
FAQ
I found two problems.

First, it seems that Field.Text is used when Field.Keyword should be used to
add the date fields to the document.

Second, in the testAfter code, I think the intent was to index the document
at time 'now + 888888', not 'now - 888888'.

When I make the change below the test succeeds.

Doug

diff -u -w -u -w -r1.2 TestDateFilter.java
--- TestDateFilter.java 19 Apr 2002 20:29:19 -0000 1.2
+++ TestDateFilter.java 7 May 2002 21:52:12 -0000
@@ -97,7 +97,7 @@

Document doc = new Document();
// add time that is in the past
- doc.add(Field.Text("datefield", DateField.timeToString(now -
1000)));
+ doc.add(Field.Keyword("datefield", DateField.timeToString(now -
1000)));
doc.add(Field.Text("body", "Today is a very sunny day in New York
City"));
writer.addDocument(doc);
writer.optimize();
@@ -155,7 +155,7 @@

Document doc = new Document();
// add time that is in the future
- doc.add(Field.Text("datefield", DateField.timeToString(now -
888888)));
+ doc.add(Field.Keyword("datefield", DateField.timeToString(now +
888888)));
doc.add(Field.Text("body", "Today is a very sunny day in New York
City"));
writer.addDocument(doc);
writer.optimize();
-----Original Message-----
From: Peter Carlson

Sent: Tuesday, May 07, 2002 11:03 AM
To: dcutting@grandcentral.com
Subject: DateFilter failing unit test, need some suggestions


Hi,

I am trying to resolve some last minute issue with RC5.

As pointed out by Brian, the TestDateFilter unit test fails.

I have looked at the code and I cannot figure out why.

Has anyone ever worked with DateFilter and got it to work.
Can someone send
me an example I can use for the TestDateFilter.

Thanks

--Peter


--
To unsubscribe, e-mail:
For additional commands, e-mail:
--
To unsubscribe, e-mail:
For additional commands, e-mail:

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 6 | next ›
Discussion Overview
groupdev @
categorieslucene
postedMay 8, '02 at 5:36p
activeMay 9, '02 at 2:51p
posts6
users3
websitelucene.apache.org

People

Translate

site design / logo © 2021 Grokbase