Thanks.

The data for the "catid" comes from another system, and is actually a string 
with a start { and an end }.

I was confused that it works in a q parameter but not fq.

I think the easiest for me, is simply to strip the start and end characters 
when I feed to the index.


Thanks

________________________________________
Fra: Jack Krupansky <j...@basetechnology.com>
Sendt: 23. oktober 2013 12:59
Til: solr-user@lucene.apache.org
Emne: Re: fq with { or } in Solr 4.3.1

Are you using the edismax query parser? It traps the syntax error and then
escapes or ignores special characters.

Curly braces are used for exclusive range queries (square brackets are
inclusive ranges). The proper syntax is "{term1 TO term2}".

So, what were your intentions with "catid:{123}"? If you are simply trying
to pass the braces as literal characters for a string field, either escape
them with backslash or enclose the entire term in quotes:

catid:\{123\}

catid:"{123}"

-- Jack Krupansky

-----Original Message-----
From: Peter Kirk
Sent: Wednesday, October 23, 2013 4:57 AM
To: solr-user@lucene.apache.org
Subject: RE: fq with { or } in Solr 4.3.1

Sorry, that was just a typo.

/ search?q=*:*&fq=catid:{123}

Gives me the error.

I think that { and } must be used in ranges for fq, and that's why I can't
use them directly like this.

/Peter



-----Original Message-----
From: Upayavira [mailto:u...@odoko.co.uk]
Sent: 23. oktober 2013 10:52
To: solr-user@lucene.apache.org
Subject: Re: fq with { or } in Solr 4.3.1

Missing a colon before the curly bracket in the fq?

On Wed, Oct 23, 2013, at 09:42 AM, Peter Kirk wrote:
> Hi
>
> If I do a search like
> /search?q=catid:{123}
>
> I get the results I expect.
>
> But if I do
> /search?q=*:*&fq=catid{123}
>
> I get an error from Solr like:
> org.apache.solr.search.SyntaxError: Cannot parse 'catid:{123}':
> Encountered " "}" "} "" at line 1, column 58. Was expecting one of: "TO"
> ... <RANGE_QUOTED> ... <RANGE_GOOP> ...
>
>
> Can I not use { or } in an fq?
>
> Thanks,
> Peter

Reply via email to