throws ClassNotFoundException, IOException, IllegalArgumentException,
NoSuchFieldException, IllegalAccessException, InstantiationException,
NullPointerException {
Document oDoc = new Document();
oDoc.add (new Field("workarea" , sWorkArea, Field.Store.YES, Field.Index.UN_TOKENIZED));
oDoc.add (new Field("container", sProject , Field.Store.YES, Field.Index.UN_TOKENIZED));
oDoc.add (new Field("guid" , sGuid , Field.Store.YES, Field.Index.UN_TOKENIZED));
oDoc.add (new Field("number" , String.valueOf(iNumber), Field.Store.YES, Field.Index.UN_TOKENIZED));
oDoc.add (new Field("title" , sTitle, Field.Store.YES, Field.Index.TOKENIZED));
oDoc.add (new Field("created" , DateTools.dateToString(dtCreated, DateTools.Resolution.SECOND), Field.Store.YES, Field.Index.UN_TOKENIZED));
oDoc.add (new Field("writer" , sWriter, Field.Store.YES, Field.Index.UN_TOKENIZED));
if (null!=sStatus) oDoc.add (new Field("status" , sStatus, Field.Store.YES, Field.Index.UN_TOKENIZED));
if (null!=sType) oDoc.add (new Field("type" , sType , Field.Store.YES, Field.Index.UN_TOKENIZED));
if (null!=oPriority) oDoc.add (new Field("priority" , oPriority.toString(), Field.Store.YES, Field.Index.UN_TOKENIZED));
if (null!=oSeverity) oDoc.add (new Field("severity" , oSeverity.toString(), Field.Store.YES, Field.Index.UN_TOKENIZED));
if (null!=sReportedBy) oDoc.add (new Field("author" , sReportedBy, Field.Store.YES, Field.Index.TOKENIZED));
if (null==sComments)
oDoc.add (new Field("comments", "", Field.Store.NO, Field.Index.TOKENIZED));
else
oDoc.add (new Field("comments", sComments, Field.Store.NO, Field.Index.TOKENIZED));
if (null==sText) {
oDoc.add (new Field("text", "", Field.Store.NO, Field.Index.TOKENIZED));
oDoc.add (new Field("abstract", "", Field.Store.YES, Field.Index.TOKENIZED));
} else {
oDoc.add (new Field("text", sText, Field.Store.NO, Field.Index.TOKENIZED));
if (sText.length()>80)
oDoc.add (new Field("abstract", sText.substring(0,80).replace('\n',' ').replace('\r',' '), Field.Store.YES, Field.Index.TOKENIZED));
else
oDoc.add (new Field("abstract", sText.replace('\n',' ').replace('\r',' '), Field.Store.YES, Field.Index.TOKENIZED));
}
oIWrt.addDocument(oDoc);
} // addBug