Quoting parameters and search phrase with spaces

50 views
Skip to first unread message

Carsten Senger

unread,
Apr 1, 2011, 12:19:52 PM4/1/11
to sol...@googlegroups.com
Hi,

I have a query where I want to limit the result based on the value of a
solr.StrField. This is not tokenized and the value can contain spaces, like
"Region A". I can query this with a search phrase that is quoted with
double quotes, but it failes if the double quotes are url encoded.

A working url is:

fq=%2Bregion%3A"Region+A"

But SearchHandler.raw() urlencodes all parameters passed in and queries
with:

fq=%2Bregion%3A%22Region+A%22

which does not match. Is there a way do such a query with solrpy?

Thanks,

..Carsten

Ed Summers

unread,
Apr 1, 2011, 2:48:47 PM4/1/11
to solrpy
it's probably worth entering this into the issue tracker as a bug. I'm
not sure what the fix is off the top of my head, and it's worth
tracking.

//Ed

Carsten Senger

unread,
Apr 2, 2011, 4:38:05 AM4/2/11
to sol...@googlegroups.com
--On Freitag, April 01, 2011 11:48:47 -0700
Ed Summers <e...@pobox.com> wrote:

> it's probably worth entering this into the issue tracker as a bug. I'm
> not sure what the fix is off the top of my head, and it's worth
> tracking.

Thanks for your answer. I added a
<http://code.google.com/p/solrpy/issues/detail?id=26>.

I looked at SearchHandler.raw(). It would be possible if fq (and q) would
also accept lists of 2-tuples that contain (fieldname, value). Then it
could urlencode fieldname and value and quote value afterwards. This should
be backwards compatible too.

I see if I can come up with a patch.

..Carsten


> On Apr 1, 12:19 pm, Carsten Senger <sen...@rehfisch.de> wrote:
>> Hi,
>>
>> I have a query where I want to limit the result based on the value of a
>> solr.StrField. This is not tokenized and the value can contain spaces,
>> like "Region A". I can query this with a search phrase that is quoted
>> with double quotes, but it failes if the double quotes are url encoded.
>>
>> A working url is:
>>
>>  fq=%2Bregion%3A"Region+A"
>>
>> But SearchHandler.raw() urlencodes all parameters passed in and queries
>> with:
>>
>>  fq=%2Bregion%3A%22Region+A%22
>>
>> which does not match. Is there a way do such a query with solrpy?
>>
>> Thanks,
>>
>> ..Carsten
>

> --
> You received this message because you are subscribed to the Google Groups
> "solrpy" group. To post to this group, send email to
> sol...@googlegroups.com.
> To unsubscribe from this group, send email to
> solrpy+un...@googlegroups.com. For more options, visit this group
> at http://groups.google.com/group/solrpy?hl=en.
>


Reply all
Reply to author
Forward
0 new messages