shivasakthi18 / alfresco-business-reporting

Automatically exported from code.google.com/p/alfresco-business-reporting
0 stars 0 forks source link

Oracle and lucene query on modification date #44

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install last Alfresco Business Reporting on Afresco
2. Configure it on Oracle (I've also add -Duser.timezone=CET to JAVA_OPTS)
3. Execute Harvesting More Frequent

What is the expected output? What do you see instead?

All table created instead, I receive an error on the follow lucene query:

TYPE:"cm:folder" AND NOT TYPE:"st:site" AND NOT TYPE:"dl:dataList" AND NOT 
TYPE:"bpm:package" AND NOT TYPE:"cm:systemfolder" AND NOT TYPE:"fm:forum" AND 
NOT TYPE:"fm:post" AND NOT TYPE:"fm:topic" AND NOT @cm:name:emplo* AND NOT 
@cm:name:persn* AND NOT @cm:creator:System AND 
@cm\:modified:[1970-01-01T01:00:00 TO NOW]

Note that I'm not able to run this query on Node Browser.
If I remove @cm\:modified:[1970-01-01T01:00:00 TO NOW] all work fine
In the same way seems works adding '' (@cm\:modified:['1970-01-01T01:00:00' TO 
NOW]

What version of the product are you using? On what operating system?
Alfresco 4.0.d
Alfresco Business Reporting 1.0.1.4
DB: Oracle 11g R2
OS: Linux Centos 7 x64

Please provide any additional information below.

The detailed error is:

SEVERE: org.apache.solr.common.SolrException: 
org.apache.lucene.queryParser.ParseException: Cannot parse 'TYPE:"cm:folder" 
AND NOT TYPE:"st:site" AND NOT TYPE:"dl:dataList" AND NOT TYPE:"bpm:package" 
AND NOT TYPE:"cm:systemfolder" AND NOT TYPE:"fm:forum" AND NOT TYPE:"fm:post" 
AND NOT TYPE:"fm:topic" AND NOT @cm:name:emplo* AND NOT @cm:name:persn* AND NOT 
@cm:creator:System AND @cm\:modified:[1970-01-01T01:00:00 TO NOW] ': 
Encountered " ":" ": "" at line 1, column 212.
Was expecting one of:
    <EOF> 
    <AND> ...
    <OR> ...
    <NOT> ...
    "+" ...
    "-" ...
    "(" ...
    "*" ...
    "^" ...
    <QUOTED> ...
    <TERM> ...
    <FUZZY_SLOP> ...
    <PREFIXTERM> ...
    <WILDTERM> ...
    "[" ...
    "{" ...
    <NUMBER> ...

    at org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:108)
    at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:174)
    at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
    at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)
    at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.lucene.queryParser.ParseException: Cannot parse 
'TYPE:"cm:folder" AND NOT TYPE:"st:site" AND NOT TYPE:"dl:dataList" AND NOT 
TYPE:"bpm:package" AND NOT TYPE:"cm:systemfolder" AND NOT TYPE:"fm:forum" AND 
NOT TYPE:"fm:post" AND NOT TYPE:"fm:topic" AND NOT @cm:name:emplo* AND NOT 
@cm:name:persn* AND NOT @cm:creator:System AND 
@cm\:modified:[1970-01-01T01:00:00 TO NOW] ': Encountered " ":" ": "" at line 
1, column 212.
Was expecting one of:
    <EOF> 
    <AND> ...
    <OR> ...
    <NOT> ...
    "+" ...
    "-" ...
    "(" ...
    "*" ...
    "^" ...
    <QUOTED> ...
    <TERM> ...
    <FUZZY_SLOP> ...
    <PREFIXTERM> ...
    <WILDTERM> ...
    "[" ...
    "{" ...
    <NUMBER> ...

    at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:205)
    at org.alfresco.solr.query.AlfrescoLuceneQParserPlugin$AlfrescoLuceneQParser.parse(AlfrescoLuceneQParserPlugin.java:102)
    at org.apache.solr.search.QParser.getQuery(QParser.java:131)

Original issue reported on code.google.com by vincenzo...@gmail.com on 24 Nov 2014 at 5:24

GoogleCodeExporter commented 8 years ago
Hi Tjarda,

I've solved setting the query in harvestingMoreFrequent using \\

folder=TYPE:"cm:folder" AND NOT TYPE:"st:site" AND NOT TYPE:"dl:dataList" AND 
NOT TYPE:"bpm:package" AND NOT TYPE:"cm:systemfolder" AND NOT TYPE:"fm:forum" 
AND NOT TYPE:"fm:post" AND NOT TYPE:"fm:topic" AND NOT @cm:\\name:emplo* AND 
NOT @cm:\\name:persn* AND NOT @cm\\:creator:System

BR
Vincenzo

Original comment by vincenzo...@gmail.com on 24 Nov 2014 at 6:31

GoogleCodeExporter commented 8 years ago
Vincenzo,

Thanks for the question. And the answer :-)

Does it work for you to change the query as displayed? Or is the 
'modified-query' getting you in trouble anyway?

(The 'modified query' part is needed to be able to find only incremental 
changes since last successful Harvesting run...)

Original comment by tjarda.p...@incentro.com on 24 Nov 2014 at 10:19

GoogleCodeExporter commented 8 years ago
Hi Tjarda,

Initially I thinked that the modified-query was the cause but I see that change 
the query adding \\ solve the problem.

However I see that there is a difference between DB. In MySQL, using 0.8.0.3 
version all work fine with just \. Starting from 1.0.1.4 I and in Oracle I see 
that need \\

BR
Vincenzo

Original comment by vincenzo...@gmail.com on 25 Nov 2014 at 8:40