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 Dean Pullen <De...@msp-uk.com> on 2009/09/08 18:10:48 UTC

Whitespace in query

Hi all,

I'm trying to filter by a 'document name' which has spaces in it.
(E.g. "docname:Struts 1" )

However, the query parameter throws an exception:

[08 Sep 2009 17:01:36] DEBUG httpclient.wire.header  - >> "GET /solr/select/?q=((docname:Struts 1))&fl=id&start=0&rows=1 HTTP/1.1[\r][\n]"[08 Sep 2009 17:01:36] DEBUG httpclient.wire.header  - >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"[08 Sep 2009 17:01:36] DEBUG httpclient.wire.header  - >> "Host: localhost:8080[\r][\n]"[08 Sep 2009 17:01:36] DEBUG httpclient.wire.header  - >> "[\r][\n]"
[08 Sep 2009 17:01:36] DEBUG httpclient.wire.header  - << "HTTP/1.1 505 HTTP Version Not Supported[\r][\n]"
[08 Sep 2009 17:01:36] DEBUG httpclient.wire.header  - << "Server: Apache-Coyote/1.1[\r][\n]"
[08 Sep 2009 17:01:36] DEBUG httpclient.wire.header  - << "Date: Tue, 08 Sep 2009 16:01:36 GMT[\r][\n]"
[08 Sep 2009 17:01:36] DEBUG httpclient.wire.header  - << "Connection: close[\r][\n]"
[08 Sep 2009 17:01:36] ERROR com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor  - Method failed: HTTP/1.1 505 HTTP Version Not Supported
com.msp.solr.SolrException: Method failed: HTTP/1.1 505 HTTP Version NotSupported

Even when I URLEncode the value, e.g. to docname:Struts+1 it doesn't work.

How do I go about correcting this?

Regards,

Dean.

Re: Whitespace in query

Posted by Chris Hostetter <ho...@fucit.org>.
: Subject: Whitespace in query
: 
: Hi all,
: 
: I'm trying to filter by a 'document name' which has spaces in it.
: (E.g. "docname:Struts 1" )

1) if you want to make a string with field with a space in it, that 
typically means using quotes -- either to query a literaly string field 
exactly or to use a phrase query...
   docname:"Struts 1"

2) your error message has nothing to do with having whitespace in your 
query...

: [08 Sep 2009 17:01:36] DEBUG httpclient.wire.header  - << "HTTP/1.1 505 HTTP Version Not Supported[\r][\n]"

505 is usually thrown by HTTP daemons that don't understand HTTP/1.1, but 
from what i can tell Coyote should support 1.1, so i'm not sure why you 
owuld be getting this error ... do *any* requests work for you?  did you 
try executing a search from the browser?

have you considered using SolrJ?



-Hoss


Re: Whitespace in query

Posted by AHMET ARSLAN <io...@yahoo.com>.

--- On Tue, 9/8/09, Dean Pullen <De...@msp-uk.com> wrote:

> From: Dean Pullen <De...@msp-uk.com>
> Subject: Whitespace in query
> To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
> Date: Tuesday, September 8, 2009, 7:10 PM
> Hi all,
> 
> I'm trying to filter by a 'document name' which has spaces
> in it.
> (E.g. "docname:Struts 1" )

You can try q=docname:(Struts 1). What is the field type of docname?

docname:Struts 1 is parsed to docname:Struts defaultField:1