How to include some more fields to be indexed in the file document class?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to include some more fields to be indexed in the file document class?

DHIVYA M
Hi all,
 
Am using lucene 2.3.2.
I would like to include some more fields of the to be indexed other than the available one.
 
In the FileDocument class of the demo version of lucene 2.3.2 there are only three fields added to the documents to be indexed.
 
Ex: doc.add(new Field("path"..........
      doc.add(new Field("modified".........
      doc.add(new Field("contents"..........
 
 
If i want to add some more fields,
like
 
      doc.add(new Field("xyz"........
 
what should i do?
Should i modify the class file and include it again in my web lucene? Or any other simpler way is possible?
Kindly let me know.
 
Thanks in advance,
Dhivya


      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/
Reply | Threaded
Open this post in threaded view
|

Re: How to include some more fields to be indexed in the file document class?

Anshum-2
Hi Dhivya,
So are you using the same demo code for your app? Incase you are you have to
modify that code and continue.
All said and done, you'd have to add fields in your java file and
recompile(in case you are already using some code for that purpose). In case
you would be starting to write an indexer from scratch, you'd have to write
a java file on the same  lines as the demo (modified) and include it.
Does that help?

--
Anshum Gupta
Naukri Labs!
http://ai-cafe.blogspot.com

The facts expressed here belong to everybody, the opinions to me. The
distinction is yours to draw............


On Fri, Dec 4, 2009 at 2:34 PM, DHIVYA M <[hidden email]> wrote:

> Hi all,
>
> Am using lucene 2.3.2.
> I would like to include some more fields of the to be indexed other than
> the available one.
>
> In the FileDocument class of the demo version of lucene 2.3.2 there are
> only three fields added to the documents to be indexed.
>
> Ex: doc.add(new Field("path"..........
>       doc.add(new Field("modified".........
>       doc.add(new Field("contents"..........
>
>
> If i want to add some more fields,
> like
>
>       doc.add(new Field("xyz"........
>
> what should i do?
> Should i modify the class file and include it again in my web lucene? Or
> any other simpler way is possible?
> Kindly let me know.
>
> Thanks in advance,
> Dhivya
>
>
>      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
> http://in.yahoo.com/
Reply | Threaded
Open this post in threaded view
|

Re: How to include some more fields to be indexed in the file document class?

DHIVYA M
Thanx for the suggestion sir.
But i wrote the Document of FileDocument class here in my indexing program so that it vl look this method rather than refering the one from the jar file.
 
Updating the jar by creating a class again seemed to be time consuming for me so did this way.
 
Thanks,
Dhivya

--- On Fri, 4/12/09, Anshum <[hidden email]> wrote:


From: Anshum <[hidden email]>
Subject: Re: How to include some more fields to be indexed in the file document class?
To: [hidden email]
Date: Friday, 4 December, 2009, 9:57 AM


Hi Dhivya,
So are you using the same demo code for your app? Incase you are you have to
modify that code and continue.
All said and done, you'd have to add fields in your java file and
recompile(in case you are already using some code for that purpose). In case
you would be starting to write an indexer from scratch, you'd have to write
a java file on the same  lines as the demo (modified) and include it.
Does that help?

--
Anshum Gupta
Naukri Labs!
http://ai-cafe.blogspot.com

The facts expressed here belong to everybody, the opinions to me. The
distinction is yours to draw............


On Fri, Dec 4, 2009 at 2:34 PM, DHIVYA M <[hidden email]> wrote:

> Hi all,
>
> Am using lucene 2.3.2.
> I would like to include some more fields of the to be indexed other than
> the available one.
>
> In the FileDocument class of the demo version of lucene 2.3.2 there are
> only three fields added to the documents to be indexed.
>
> Ex: doc.add(new Field("path"..........
>       doc.add(new Field("modified".........
>       doc.add(new Field("contents"..........
>
>
> If i want to add some more fields,
> like
>
>       doc.add(new Field("xyz"........
>
> what should i do?
> Should i modify the class file and include it again in my web lucene? Or
> any other simpler way is possible?
> Kindly let me know.
>
> Thanks in advance,
> Dhivya
>
>
>      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
> http://in.yahoo.com/



      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/