Re: Fwd: Trouble with Velocity in SOLR 5.0.0

2015-03-11 Thread Sergiu Dumitriu
That's a change in the velocity engine, the way nested quotes are
escaped is by doubling them:

#set ($temp0 = $paramsq.replaceAll(, ))

Or better:

#set ($temp0 = $paramsq.replaceAll('', ''))

I guess Solr 5 upgraded the version of Velocity they embed, thus the
regression in your code.

On 03/11/2015 04:46 AM, phi...@free.fr wrote:
 
 Good morning,
 
 I have found the cause of the error (see below) in this line:
 
 #set ($temp0 = $paramsq.replaceAll(\, ))
 
 I replaced \ by \u0022, and the error message vanished.
 
 #set ($temp0 = $test.replaceAll(\u0022, ))
 
 Philippe
 
 
 
 ERROR 500
 Encountered AND at richtext_doc.vm[line 65, column 51] Was expecting one 
 of: , ... ) ... ... 
 
 -
 
 
 #if ($params.q and $pdf_dir_v and $pdf_year_mon_v and $pdf_day_v and 
 $pdf_name_v)
 
   #set ($paramsq = $params.q)
   
   #if ($paramsq.length()  0)
   
   paramsq = $paramsq
   
   ## Remove double quotes
   #set ($temp0 = $paramsq.replaceAll(\, ))
 
 
 
 -
 
 
 
 
 
 
 - Mail transféré -
 De: phi...@free.fr
 À: Velocity Users List user@velocity.apache.org
 Envoyé: Mardi 10 Mars 2015 16:29:48
 Objet: Re: Trouble with Velocity in SOLR 5.0.0
 
 Problem solved.
 
 A query Response Writer was not declared in my solrconfig.xml file.
 
  queryResponseWriter name=velocity class=solr.VelocityResponseWriter 
 startup=lazy
 str name=template.base.dir${velocity.template.base.dir:}/str
   /queryResponseWriter
   
 
 
 
 - Mail original -
 De: phi...@free.fr
 À: Velocity Users List user@velocity.apache.org
 Envoyé: Mardi 10 Mars 2015 14:16:41
 Objet: Trouble with Velocity in SOLR 5.0.0
 
 Hello,
 
 I am trying to make Velocity work in SOLR 5.0.0.
 
 First of all, I have added the following lines to my core's solrconfig.xml 
 file:
 
 luceneMatchVersion5.0.0/luceneMatchVersion
   
   lib dir=../../../contrib/extraction/lib regex=.*\.jar /
   lib dir=../../../dist/ regex=solr-cell-\d.*\.jar /
 
   lib dir=../../../contrib/langid/lib/ regex=.*\.jar /
   lib dir=../../../dist/ regex=solr-langid-\d.*\.jar /
 
   lib dir=../../../contrib/velocity/lib regex=.*\.jar /
   lib dir=../../../dist/ regex=solr-velocity-\d.*\.jar /
 ...
 
 
 ... and created a /browse request handler
 
 
  requestHandler name=/browse class=solr.SearchHandler
  lst name=defaults
str name=echoParamsexplicit/str
 
!-- VelocityResponseWriter settings --
str name=wtvelocity/str
str name=v.templatebrowse/str
str name=v.layoutlayout/str
str name=titleArchives/str
 
!-- Query settings --
str name=defTypeedismax/str
  
 I have also copied the 'velocity' directory from a 4.9 core to the 
 
 /archives/solr-5.0.0/server/solr/mycore1/conf directory  
 
 as well as the toolbox.xml file.
 
 
 The mycore1's conf directory now contains the following files and directories:
 
 currency.xml  lang  protwords.txt  _rest_managed.json  schema.xml  
 solrconfig.xml  stopwords.txt  synonyms.txt  toolbox.xml  velocity
 
 
 
 When I type http://myserver.com:8990/solr/mycore1/select?q=*:* in a browser, 
 I get an XML page, not HTML generated by Velocity, as expected.
 
 response
 lst name=responseHeader
 int name=status0/int
 int name=QTime5/int
 lst name=params/
 /lst
 result name=response numFound=0 start=0 maxScore=0.0/
 lst name=facet_counts
 lst name=facet_queries/
 lst name=facet_fields
 lst name=ymd/
 /lst
 lst name=facet_dates/
 lst name=facet_ranges/
 lst name=facet_intervals/
 /lst
 lst name=highlighting/
 /response
 
 
 What did I miss?
 
 Cheers,
 
 Philippe
 
 
 
 
 
 
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
 For additional commands, e-mail: user-h...@velocity.apache.org
 


-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/

-
To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
For additional commands, e-mail: user-h...@velocity.apache.org



Fwd: Trouble with Velocity in SOLR 5.0.0

2015-03-11 Thread phiroc

Good morning,

I have found the cause of the error (see below) in this line:

#set ($temp0 = $paramsq.replaceAll(\, ))

I replaced \ by \u0022, and the error message vanished.

#set ($temp0 = $test.replaceAll(\u0022, ))

Philippe



ERROR 500
Encountered AND at richtext_doc.vm[line 65, column 51] Was expecting one of: 
, ... ) ... ... 

-


#if ($params.q and $pdf_dir_v and $pdf_year_mon_v and $pdf_day_v and 
$pdf_name_v)

#set ($paramsq = $params.q)

#if ($paramsq.length()  0)

paramsq = $paramsq

## Remove double quotes
#set ($temp0 = $paramsq.replaceAll(\, ))



-






- Mail transféré -
De: phi...@free.fr
À: Velocity Users List user@velocity.apache.org
Envoyé: Mardi 10 Mars 2015 16:29:48
Objet: Re: Trouble with Velocity in SOLR 5.0.0

Problem solved.

A query Response Writer was not declared in my solrconfig.xml file.

 queryResponseWriter name=velocity class=solr.VelocityResponseWriter 
startup=lazy
str name=template.base.dir${velocity.template.base.dir:}/str
  /queryResponseWriter
  



- Mail original -
De: phi...@free.fr
À: Velocity Users List user@velocity.apache.org
Envoyé: Mardi 10 Mars 2015 14:16:41
Objet: Trouble with Velocity in SOLR 5.0.0

Hello,

I am trying to make Velocity work in SOLR 5.0.0.

First of all, I have added the following lines to my core's solrconfig.xml file:

luceneMatchVersion5.0.0/luceneMatchVersion
  
  lib dir=../../../contrib/extraction/lib regex=.*\.jar /
  lib dir=../../../dist/ regex=solr-cell-\d.*\.jar /

  lib dir=../../../contrib/langid/lib/ regex=.*\.jar /
  lib dir=../../../dist/ regex=solr-langid-\d.*\.jar /

  lib dir=../../../contrib/velocity/lib regex=.*\.jar /
  lib dir=../../../dist/ regex=solr-velocity-\d.*\.jar /
...


... and created a /browse request handler


 requestHandler name=/browse class=solr.SearchHandler
 lst name=defaults
   str name=echoParamsexplicit/str

   !-- VelocityResponseWriter settings --
   str name=wtvelocity/str
   str name=v.templatebrowse/str
   str name=v.layoutlayout/str
   str name=titleArchives/str

   !-- Query settings --
   str name=defTypeedismax/str
 
I have also copied the 'velocity' directory from a 4.9 core to the 

/archives/solr-5.0.0/server/solr/mycore1/conf directory  

as well as the toolbox.xml file.


The mycore1's conf directory now contains the following files and directories:

currency.xml  lang  protwords.txt  _rest_managed.json  schema.xml  
solrconfig.xml  stopwords.txt  synonyms.txt  toolbox.xml  velocity



When I type http://myserver.com:8990/solr/mycore1/select?q=*:* in a browser, I 
get an XML page, not HTML generated by Velocity, as expected.

response
lst name=responseHeader
int name=status0/int
int name=QTime5/int
lst name=params/
/lst
result name=response numFound=0 start=0 maxScore=0.0/
lst name=facet_counts
lst name=facet_queries/
lst name=facet_fields
lst name=ymd/
/lst
lst name=facet_dates/
lst name=facet_ranges/
lst name=facet_intervals/
/lst
lst name=highlighting/
/response


What did I miss?

Cheers,

Philippe








-
To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
For additional commands, e-mail: user-h...@velocity.apache.org