java - Get the content of Notes Document with attachment file to Solr Document -
things trying follows.
i have notes document fields [from (type:text),to(type:text), attachment(type:richtext )] , trying create solrdocument
of notes document mentioned above.
this after creating solrdocument
, saved solr server how solrdocument
looking follow.
<doc> <str name="contid">340dd508d43f2f2965257ecf0045af1c</str> // saving unid of doc <arr name="cmrights"> <str>dummyvalue</str> <str>dummyvalue1</str> <str>dummyvalue2</str> <str>dummyvalue3</str> </arr> <str name="frommail">sender@gmail.com</str> <date name="posteddate">2015-09-29t12:41:08z</date> <arr name="sendto"> <str>receiver@gmial.com</str> </arr> <str name="subject">notesslrwriter</str> </doc>
to write above solrinputdocument
use following methods(its part of class)
private void writefields() throws exception { writefield("contid", doc.getuniversalid()); writefield("cmrights", multivalues); writefield("dbtype", arvconfig); collection<idxfield> fields = fieldstoindex(arvconfig); (idxfield idxfield : fields) { int type = idxfield.getdatatype(); switch (type) { case sqlfielddesc.date: string datefield = idxfield.getarcname(); collection<date> dvalues = new arraylist<date>(); string d2 = doc.getitemvaluedatetimearray(datefield).get(0) .tostring(); // system.out.println(d2); simpledateformat sdf = new simpledateformat( "mm/dd/yyyy hh:mm:ss a"); date d4 = sdf.parse(d2); system.out.println("new date is: " + d4.tostring()); dvalues.add(d4); system.out.println(datefield.tolowercase()); system.out.println(doc.getitemvalue(datefield).tostring()); writedatefield(datefield.tolowercase(), dvalues); break; case sqlfielddesc.numint: system.out.println("number fields"); break; default: final string fieldname = idxfield.getarcname(); writefield(fieldname.tolowercase(), doc.getitemvaluestring(idxfield.getarcname())); system.out.println(fieldname); system.out .println(doc.getitemvaluestring(idxfield.getarcname())); break; } } }
so, want this.
solrinputdocument.writefiles(attachment , files attached);
something have write method, don't understand how deal or how start it, field of notes document "attachment" in richtextformat.
i think can dxl of current document.then have content via dxl problem how content in solrdocument.
there way or steps me lead me towards solution.
thank reading question.
you can html representation of richtext field url
http://server/db.nsf/view/docunid/richtextfieldname?openfield
just read richtext field's content in html format via http url.
example:
http://server/db.nsf/0/af665be72463477ac1257eb90039e589/body?openfield
Comments
Post a Comment