You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Ken Krugler <kk...@transpac.com> on 2010/06/20 02:46:07 UTC

Minor bug in Solritas with post-facet search

I ran into one minor problem, where if I clicked a facet, and then  
tried a search, I'd get a 404 error.

I think the problem is with the fqs Velocity macro in  
VM_global_library.vm, where it's missing the #else to insert a '?'  
into the URL:

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

Without this, the URL becomes /solr/browsefq=xxxx, instead of /solr/ 
browse?fq=xxxx

But I'm completely new to the world of Velocity templating, so I've  
got low confidence that this is the right way to fix it.

-- Ken

--------------------------------------------
Ken Krugler
+1 530-210-6378
http://bixolabs.com
e l a s t i c   w e b   m i n i n g





Re: Minor bug in Solritas with post-facet search

Posted by Chantal Ackermann <ch...@btelligent.de>.
Hi Eric,

only with POST the action attribute in the form element is allowed to
have a query string. With GET, the query string is removed.

(Don't ask me why, though.)

Chantal

On Sun, 2010-06-20 at 04:44 +0200, Erik Hatcher wrote:
> Fixed.
> 
> <form> action URLs really shouldn't have query string parameters on  
> them anyway, nor do they appear to work if so, so I moved the fq's to  
> hidden input fields.
> 
> Adding the ? into the URLs gets tricky, and doing it in #fqs isn't the  
> right place, as those are often tacked on after other parameters where  
> the ? has already been added.
> 
> 	Erik
> 
> On Jun 19, 2010, at 8:46 PM, Ken Krugler wrote:
> 
> > I ran into one minor problem, where if I clicked a facet, and then  
> > tried a search, I'd get a 404 error.
> >
> > I think the problem is with the fqs Velocity macro in  
> > VM_global_library.vm, where it's missing the #else to insert a '?'  
> > into the URL:
> >
> > #macro(fqs $p)#foreach($fq in $p)#if($velocityCount>1)&#{else}? 
> > #{end}fq=$esc.url($fq)#end#end
> >
> > Without this, the URL becomes /solr/browsefq=xxxx, instead of /solr/ 
> > browse?fq=xxxx
> >
> > But I'm completely new to the world of Velocity templating, so I've  
> > got low confidence that this is the right way to fix it.
> >
> > -- Ken
> >
> > --------------------------------------------
> > Ken Krugler
> > +1 530-210-6378
> > http://bixolabs.com
> > e l a s t i c   w e b   m i n i n g
> >
> >
> >
> >
> 




Re: Minor bug in Solritas with post-facet search

Posted by Erik Hatcher <er...@gmail.com>.
Fixed.

<form> action URLs really shouldn't have query string parameters on  
them anyway, nor do they appear to work if so, so I moved the fq's to  
hidden input fields.

Adding the ? into the URLs gets tricky, and doing it in #fqs isn't the  
right place, as those are often tacked on after other parameters where  
the ? has already been added.

	Erik

On Jun 19, 2010, at 8:46 PM, Ken Krugler wrote:

> I ran into one minor problem, where if I clicked a facet, and then  
> tried a search, I'd get a 404 error.
>
> I think the problem is with the fqs Velocity macro in  
> VM_global_library.vm, where it's missing the #else to insert a '?'  
> into the URL:
>
> #macro(fqs $p)#foreach($fq in $p)#if($velocityCount>1)&#{else}? 
> #{end}fq=$esc.url($fq)#end#end
>
> Without this, the URL becomes /solr/browsefq=xxxx, instead of /solr/ 
> browse?fq=xxxx
>
> But I'm completely new to the world of Velocity templating, so I've  
> got low confidence that this is the right way to fix it.
>
> -- Ken
>
> --------------------------------------------
> Ken Krugler
> +1 530-210-6378
> http://bixolabs.com
> e l a s t i c   w e b   m i n i n g
>
>
>
>