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 anushri kumar <an...@yahoo.com> on 2005/10/31 18:36:35 UTC
Indexing dates
Hi,
I was trying to index dates. I wrote
Document doc = new Document();
doc.add(Field.Keyword("indexdate",new Date() ));
but while running the program it gave me the following error.
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.lucene.docume
nt.Field.Keyword(Ljava/lang/String;Ljava/util/Date;)Lorg/apache/lucene/document/
Field;
at lia.handlingtypes.msdoc.TextMiningWordDocHandler.getDocument(TextMini
ngWordDocHandler.java:40)
at lia.handlingtypes.framework.ExtensionFileHandler.getDocument(Extensio
nFileHandler.java:41)
at lia.handlingtypes.framework.FileIndexer.index(FileIndexer.java:43)
at lia.handlingtypes.framework.FileIndexer.index(FileIndexer.java:36)
at lia.handlingtypes.framework.FileIndexer.index(FileIndexer.java:36)
at lia.handlingtypes.framework.FileIndexer.main(FileIndexer.java:77)
Is there something I'm missing ?
Thanks a lot ,
Anu
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
Re: Indexing dates
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Looks like another strange classpath issue. There most certainly is
a method with that signature:
$ javap -classpath lucene-1.4.3.jar org.apache.lucene.document.Field
Compiled from "Field.java"
public final class org.apache.lucene.document.Field extends
java.lang.Object implements java.io.Serializable{
public void setBoost(float);
public float getBoost();
public static final org.apache.lucene.document.Field Keyword
(java.lang.String, java.lang.String);
public static final org.apache.lucene.document.Field UnIndexed
(java.lang.String, java.lang.String);
public static final org.apache.lucene.document.Field Text
(java.lang.String, java.lang.String);
public static final org.apache.lucene.document.Field Keyword
(java.lang.String, java.util.Date); <<<<<<<<<
public static final org.apache.lucene.document.Field Text
(java.lang.String, java.lang.String, boolean);
public static final org.apache.lucene.document.Field UnStored
(java.lang.String, java.lang.String);
public static final org.apache.lucene.document.Field UnStored
(java.lang.String, java.lang.String, boolean);
public static final org.apache.lucene.document.Field Text
(java.lang.String, java.io.Reader);
public static final org.apache.lucene.document.Field Text
(java.lang.String, java.io.Reader, boolean);
public java.lang.String name();
public java.lang.String stringValue();
public java.io.Reader readerValue();
public org.apache.lucene.document.Field(java.lang.String,
java.lang.String, boolean, boolean, boolean);
public org.apache.lucene.document.Field(java.lang.String,
java.lang.String, boolean, boolean, boolean, boolean);
org.apache.lucene.document.Field(java.lang.String, java.io.Reader);
public final boolean isStored();
public final boolean isIndexed();
public final boolean isTokenized();
public final boolean isTermVectorStored();
public final java.lang.String toString();
}
On 31 Oct 2005, at 12:36, anushri kumar wrote:
> Hi,
>
> I was trying to index dates. I wrote
>
> Document doc = new Document();
> doc.add(Field.Keyword("indexdate",new Date() ));
>
> but while running the program it gave me the following error.
>
> Exception in thread "main" java.lang.NoSuchMethodError:
> org.apache.lucene.docume
> nt.Field.Keyword(Ljava/lang/String;Ljava/util/Date;)Lorg/apache/
> lucene/document/
> Field;
> at lia.handlingtypes.msdoc.TextMiningWordDocHandler.getDocument
> (TextMini
> ngWordDocHandler.java:40)
> at lia.handlingtypes.framework.ExtensionFileHandler.getDocument
> (Extensio
> nFileHandler.java:41)
> at lia.handlingtypes.framework.FileIndexer.index(FileIndexer.java:43)
> at lia.handlingtypes.framework.FileIndexer.index(FileIndexer.java:36)
> at lia.handlingtypes.framework.FileIndexer.index(FileIndexer.java:36)
> at lia.handlingtypes.framework.FileIndexer.main(FileIndexer.java:77)
>
> Is there something I'm missing ?
>
> Thanks a lot ,
> Anu
>
>
>
> ---------------------------------
> Yahoo! FareChase - Search multiple travel sites in one click.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org