jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: Searching problems
Date Fri, 14 May 2010 13:12:08 GMT
On Thu, May 13, 2010 at 13:08, Jyo <jenni.sjr@gmail.com> wrote:
>                        FileInputStream file = new FileInputStream("C:\\New\\New.txt");
>                        Binary binary =
> JackrabbitPlugin.getSession().getValueFactory().createBinary(file);
>                        binary.dispose();

You shouldn't dispose the binary before you pass it to the property
and before you save the session!

>                        Calendar cal = Calendar.getInstance();
>                        cal.set(2008, Calendar.JUNE, 10);
>                        //in below line getBlogEntryNode() method returns
the blogEntryNode.
>                        Node blogEntryNode = getBlogEntryNode(blogTitle, session);
>                        Node newNode=blogEntryNode.addNode("newNode", "nt:folder");
>                        Node NewblogEntry = newNode.addNode("NewblogEntry",
"nt:file");
>                        Node resNode = NewblogEntry.addNode("jcr:content",
"nt:resource");
>                        resNode.setProperty("jcr:mimeType", "text/html");

Make sure you set the proper mime type here, depending on the content
you put in (above you set text/html). I am not sure if the Tika-based
text extractor depends on this, but I think so.

If it still fails, it could be because there are problems with the
specific document you have. Look for text extraction exceptions in the
log. And try with a plain text file.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message