You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Simon Lieschke <si...@orionhealth.com> on 2003/04/07 06:41:32 UTC

HTMLDocument.java example

The example code that ships with Lucene includes the following snippet in HTMLDocument.java:

    // Add the last modified date of the file a field named "modified".  Use a
    // Keyword field, so that it's searchable, but so that no attempt is made
    // to tokenize the field into words.
    doc.add(Field.Keyword("modified",
			  DateField.timeToString(f.lastModified())));

Now, I guess the point of this is so that we can search for HTML documents using Lucene's range search syntax. But as far as I can tell, the result of DateField.timeToString(f.lastModified()) returns a non-human readable date format, hence the modified field will not really be "human searchable" format. Is this an oversight in the example implementation, or am I just missing something else here?

Thanks in advance,


Simon

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: HTMLDocument.java example

Posted by Michael Wechner <mi...@wyona.org>.
Simon Lieschke wrote:
> The example code that ships with Lucene includes the following snippet in HTMLDocument.java:
> 
>     // Add the last modified date of the file a field named "modified".  Use a
>     // Keyword field, so that it's searchable, but so that no attempt is made
>     // to tokenize the field into words.
>     doc.add(Field.Keyword("modified",
> 			  DateField.timeToString(f.lastModified())));
> 
> Now, I guess the point of this is so that we can search for HTML documents using Lucene's range search syntax. But as far as I can tell, the result of DateField.timeToString(f.lastModified()) returns a non-human readable date format, hence the modified field will not really be "human searchable" format. Is this an oversight in the example implementation, or am I just missing something else here?
> 

I always thought that this is necessary for being able to incrementally 
update the index at some later stage, but I am not sure to be honest.

HTH

Michael


> Thanks in advance,
> 
> 
> Simon
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: HTMLDocument.java example

Posted by Terry Steichen <te...@net-frame.com>.
Simon,

I believe there's another method in DateField that converts the value into a
human readable form.

Regards,

Terry

----- Original Message -----
From: "Simon Lieschke" <si...@orionhealth.com>
To: <lu...@jakarta.apache.org>
Sent: Monday, April 07, 2003 12:41 AM
Subject: HTMLDocument.java example


The example code that ships with Lucene includes the following snippet in
HTMLDocument.java:

    // Add the last modified date of the file a field named "modified".  Use
a
    // Keyword field, so that it's searchable, but so that no attempt is
made
    // to tokenize the field into words.
    doc.add(Field.Keyword("modified",
  DateField.timeToString(f.lastModified())));

Now, I guess the point of this is so that we can search for HTML documents
using Lucene's range search syntax. But as far as I can tell, the result of
DateField.timeToString(f.lastModified()) returns a non-human readable date
format, hence the modified field will not really be "human searchable"
format. Is this an oversight in the example implementation, or am I just
missing something else here?

Thanks in advance,


Simon

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org