0

While using Velocity Solr I encounered an Error 400. It only occurs when I have three or more filter querys. I noticed that the query passed in the url was:

http://localhost:8983/solr/techproducts/browse?&fq=cat%3A%22electronics%22fq=manu_exact%3A%22Samsung+Electronics+Co.+Ltd.%22&debugQuery=true&q=&fq=-author_s:[*+TO+*]

However when changed to

http://localhost:8983/solr/techproducts/browse?&fq=cat%3A%22electronics%22&fq=manu_exact%3A%22Samsung+Electronics+Co.+Ltd.%22&debugQuery=true&q=&fq=-author_s:[*+TO+*]

(The & after electronics%22)

It works perfectly, the same occurs regard less of what Core I create. Is there any fix for this??

2
  • are both URL's created by velocity?
    – raghu777
    Mar 15, 2020 at 15:52
  • THe first one is generate by velocity and returns the error. However if i just add the & symbol in the url it works perfectly Mar 16, 2020 at 8:17

1 Answer 1

0

I found that in VM_global_library.vm By altering

#macro(fqs $p)#foreach($fq in $p)#if($velocityCount && $velocityCount>1)&&#{end}fq=$esc.url($fq)#end#end

to

#macro(fqs $p)#foreach($fq in $p)#if($velocityCount && $velocityCount>1)&&#{end}fq=$esc.url($fq)&#end#end

(added the & at the end, for queries with less than three parameters it will render some queries with && in the url however this is not a problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.