jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From juanillototal <juanilloto...@gmail.com>
Subject Query error when using 'OR' in the 'WHERE' part of the query.
Date Thu, 07 Jul 2011 09:53:13 GMT
Hi All There

My name is Juan and I'm developing a web application (JSP) over jackrabbit.
I have jackrabbit running OK.
I've made a new custom type called mmns:Asset which is child of nt:file.
This type has a property called 'tags' where I put some tags to look for.
I'm able to upload files and set the type of those files to mmsn:Asset.
But when I'm searching the repository, using Query.JCR_SQL2 I get an issue:

If the query is:
SELECT * FROM [mmns:Asset] As asset WHERE (NAME(asset) LIKE $searchName)
it works fine, and I get some results.

If query is:
SELECT * FROM [mmns:Asset] As asset WHERE ([mmns:tags] LIKE $searchTags)
it works fine aswell, and I get some results.

If I have this query:
SELECT * FROM [mmns:Asset] As asset WHERE (NAME(asset) LIKE $searchName) AND
([mmns:tags] LIKE $searchTags)
It works fine and I get the results.

BUT the problem comes when I try to search using 'OR' command in the WHERE
clause
SELECT * FROM [mmns:Asset] As asset WHERE (NAME(asset) LIKE $searchName) OR
([mmns:tags] LIKE $searchTags)
Then I get an error:
*******************************************************************************
13:35:32.115 ["http-bio-8080"-exec-9] DEBUG o.a.j.core.session.SessionState
- Performed node.createQuery(SELECT * FROM [mmns:Asset] As asset WHERE
(NAME(asset) LIKE $searchName) OR ([mmns:tags] LIKE $searchTags) , JCR-SQL2)
in 500us
javax.jcr.UnsupportedRepositoryOperationException
        at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.getNodeNameQuery(LuceneQueryFactory.java:584)
        at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.getComparisonQuery(LuceneQueryFactory.java:570)
        at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.create(LuceneQueryFactory.java:386)
        at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.addBooleanConstraint(LuceneQueryFactory.java:501)
        at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.getOrQuery(LuceneQueryFactory.java:477)
        at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.create(LuceneQueryFactory.java:378)
        at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.mapConstraintToQueryAndFilter(LuceneQueryFactory.java:365)
        at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.execute(LuceneQueryFactory.java:189)
        at
org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute(QueryEngine.java:222)
        at
org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute(QueryEngine.java:137)
        at
org.apache.jackrabbit.core.query.QueryObjectModelImpl.execute(QueryObjectModelImpl.java:114)
        at
com.mediamano.jackrabbit.SearchServlet.search(SearchServlet.java:156)
        at org.apache.jsp.search_jsp._jspService(search_jsp.java:76)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
        at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
******************************************************************************
       
It seems that the 'OR' operation is not implemented in jackrabbit, but the
documentatios says that it's implemented.
The jackrabit version I'm using is the lastest one: 2.2.7
Do anyone has this issue too?

Thanks
Juan.


--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Query-error-when-using-OR-in-the-WHERE-part-of-the-query-tp3651078p3651078.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Mime
View raw message