You are on the right path, just extract your content using SAX and
then you can add Fields to Lucene for each document. As long as the
values are strings, it should be the same as any indexing task. The
key of course will be using an Analyzer that understands how to
tokenize/stem Urdu.
This would look something like (I did not compile this):
Document doc = new Document()
doc.add(new Field("title", titleString, ...);
doc.add(new Field("body", bodyString, ...);
doc.add(new Field("id", id, ...);
indexWriter.addDocument(doc);
indexWriter.optimize();
indexWriter.close();
The problem really isn't any different than indexing English, except
for what Analyzer you choose. You may very well have to write your
own Analyzer/Tokenizer/TokenFilter. Other thing to be concerned with
is the character encoding as you are reading in the files. Once you
have Strings in your program, that is all Lucene needs.
Are you able to index other things in Lucene (i.e. a simple set of
unstructured documents)?
-Grant
On Dec 4, 2007, at 1:04 PM, Liaqat Ali wrote:
Hi all,
I want to index an XML file,containing 200 Urdu language (Varient of
Arabic and Persian) documents. This corpus is in CES
format,consisting of information about author and many more, I just
want to extract textual data of each document and relative Doc
number and title in each document using SAX.
The problem I m facing that what should be the output of this whole
processing, which is acceptable to Lucene Indexer. I just want to
store Document number, and Title with each document. The example
given below is Doc 2 from that XML file. I want to make complete
index of 200 documents with Doc number and title... Kindly guide
me......
<h.title>Doc 2</h.title>
<title>حکمت یار کو ایران بدر کرنے پر غور</
title>
</p>
<p>اور خبریں ہیں کہ انھیں ایران بدر
کرنے پر بھی غور کیا جا رہا ہے۔ حکمت یار
جو سابق سوویت یونین کی مداخلت کے خلاف
امریکی حمایت سے چلے والی مزاحمت میں
سامنے آۓ تھے اب مخالف خیالات کے لۓ
جانے جاتے ہیں اور اب وہ کرزئی انتظامیہ
کی بھی مخالفت کررہے تھے۔ گذشتہ ہفتے
ایران نے حکمت یار پر الزام لگایا تھا
کہ وہ ایران کی سرزمین کو افغان
انتظامیہ کے خلاف کاروائیاں کرنے کے لۓ
استعمال کررہے ہیں جب کہ ایران کا کہنا
ہے کہ وہ طالبان کے خلاف مزاحم دھڑوں کو
جو حمایت فراحم کر رہا تھا وہ طالبان کا
کنٹرول ختم ہونے کے بعد بند کر دی گئی
ہے۔ تاہم بعض ذرائع کا خیال ہے کہ ایران
نے حکمت یار کے خلاف اقدام امریکہ کے
اعتراضات کے بعد کیے ہیں۔</p>
Thanks ..... Liaqat
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------
Grant Ingersoll
http://lucene.grantingersoll.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]