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 Shamik Bandopadhyay <sh...@gmail.com> on 2018/05/15 23:41:53 UTC

Error using multiple terms in function query

Hi,

  I'm having issues using multiple terms in Solr function queries. For e.g.
I'm trying to use the following bf function using termfreq

bf=if(termfreq(ProductLine,'Test Product'),5,0)

This throws  org.apache.solr.search.SyntaxError: Missing end to unquoted
value starting at 28 str='if(termfreq(ProductLine,Test'

If I use only Test or Product i.e. a single term, the function works as
expected. I'm seeing a similar problem with other functions like
docfreq,ttf,tf,idf,etc. I'm using 6.6 but verified similar issue in 5 as
well.

Just wondering if this is an existing issue or something not supported by
Solr. Is there an alternate way to check multiple terms in a function?

Any pointers will be appreciated.

Re: Error using multiple terms in function query

Posted by Yonik Seeley <ys...@gmail.com>.
Problems like this are usually caused by the whole query not even
making it to Solr due to bad HTTP param encoding.
For example, if you're using curl with request parameters in the URL,
you need to manually encode spaces as either "+" or "%20"

-Yonik


On Tue, May 15, 2018 at 7:41 PM, Shamik Bandopadhyay <sh...@gmail.com> wrote:
> Hi,
>
>   I'm having issues using multiple terms in Solr function queries. For e.g.
> I'm trying to use the following bf function using termfreq
>
> bf=if(termfreq(ProductLine,'Test Product'),5,0)
>
> This throws  org.apache.solr.search.SyntaxError: Missing end to unquoted
> value starting at 28 str='if(termfreq(ProductLine,Test'
>
> If I use only Test or Product i.e. a single term, the function works as
> expected. I'm seeing a similar problem with other functions like
> docfreq,ttf,tf,idf,etc. I'm using 6.6 but verified similar issue in 5 as
> well.
>
> Just wondering if this is an existing issue or something not supported by
> Solr. Is there an alternate way to check multiple terms in a function?
>
> Any pointers will be appreciated.