You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Mike olo <mi...@gmail.com> on 2007/11/05 11:40:24 UTC

full text search

hi all,

i want to do the search in the repository with full text. pls let me know
how can i do it. i m using jackrabbit.1.3.3.

here is my code:

	Repository r = new TransientRepository();
				SimpleCredentials cred = new SimpleCredentials("userid", ""
						.toCharArray());
				Session session = r.login(cred, null);
				try {
					Workspace ws = session.getWorkspace();
					Node rn = session.getRootNode();

					Node fileNode = rn.addNode(resObj.getID());
					fileNode.addMixin("mix:versionable");
					fileNode.setProperty("jcr:file", new String(resObj
							.getName()));
					fileNode.setProperty("jcr:user", new String(resObj
							.getUser()));
					fileNode.setProperty("jcr:content",
							new ByteArrayInputStream(resObj.getDocument()));
					Calendar lastModified = Calendar.getInstance();
					fileNode.setProperty("jcr:lastModified", lastModified);
					session.save();
					fileNode.checkin();
				} catch (Exception e) {
					throw new CommandException(e);
				} finally {
					session.logout();
				}


Thanks,
MIke
-- 
View this message in context: http://www.nabble.com/full-text-search-tf4750749.html#a13584526
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.


RE: full text search

Posted by Ard Schrijvers <a....@hippo.nl>.
Hello Mike,

See
http://www.day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/Workspace.htm
l#getQueryManager()

and see in
http://jcp.org/aboutJava/communityprocess/final/jsr170/index.html
specification how to search with xpath or sql. 

I crosspost to user-list as well, because this is the appropriate list
for these kind of questions. pls continue thread on that list.

Regards Ard

> 
> hi all,
> 
> i want to do the search in the repository with full text. pls 
> let me know how can i do it. i m using jackrabbit.1.3.3.
> 
> here is my code:
> 
> 	Repository r = new TransientRepository();
> 				SimpleCredentials cred = new 
> SimpleCredentials("userid", ""
> 						.toCharArray());
> 				Session session = r.login(cred, null);
> 				try {
> 					Workspace ws = 
> session.getWorkspace();
> 					Node rn = session.getRootNode();
> 
> 					Node fileNode = 
> rn.addNode(resObj.getID());
> 					
> fileNode.addMixin("mix:versionable");
> 					
> fileNode.setProperty("jcr:file", new String(resObj
> 							.getName()));
> 					
> fileNode.setProperty("jcr:user", new String(resObj
> 							.getUser()));
> 					
> fileNode.setProperty("jcr:content",
> 							new 
> ByteArrayInputStream(resObj.getDocument()));
> 					Calendar lastModified = 
> Calendar.getInstance();
> 					
> fileNode.setProperty("jcr:lastModified", lastModified);
> 					session.save();
> 					fileNode.checkin();
> 				} catch (Exception e) {
> 					throw new CommandException(e);
> 				} finally {
> 					session.logout();
> 				}
> 
> 
> Thanks,
> MIke
> --
> View this message in context: 
> http://www.nabble.com/full-text-search-tf4750749.html#a13584526
> Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.
> 
> 

RE: full text search

Posted by Ard Schrijvers <a....@hippo.nl>.
Hello Mike,

See
http://www.day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/Workspace.htm
l#getQueryManager()

and see in
http://jcp.org/aboutJava/communityprocess/final/jsr170/index.html
specification how to search with xpath or sql. 

I crosspost to user-list as well, because this is the appropriate list
for these kind of questions. pls continue thread on that list.

Regards Ard

> 
> hi all,
> 
> i want to do the search in the repository with full text. pls 
> let me know how can i do it. i m using jackrabbit.1.3.3.
> 
> here is my code:
> 
> 	Repository r = new TransientRepository();
> 				SimpleCredentials cred = new 
> SimpleCredentials("userid", ""
> 						.toCharArray());
> 				Session session = r.login(cred, null);
> 				try {
> 					Workspace ws = 
> session.getWorkspace();
> 					Node rn = session.getRootNode();
> 
> 					Node fileNode = 
> rn.addNode(resObj.getID());
> 					
> fileNode.addMixin("mix:versionable");
> 					
> fileNode.setProperty("jcr:file", new String(resObj
> 							.getName()));
> 					
> fileNode.setProperty("jcr:user", new String(resObj
> 							.getUser()));
> 					
> fileNode.setProperty("jcr:content",
> 							new 
> ByteArrayInputStream(resObj.getDocument()));
> 					Calendar lastModified = 
> Calendar.getInstance();
> 					
> fileNode.setProperty("jcr:lastModified", lastModified);
> 					session.save();
> 					fileNode.checkin();
> 				} catch (Exception e) {
> 					throw new CommandException(e);
> 				} finally {
> 					session.logout();
> 				}
> 
> 
> Thanks,
> MIke
> --
> View this message in context: 
> http://www.nabble.com/full-text-search-tf4750749.html#a13584526
> Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.
> 
>