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 Rajesh <ra...@aspiresys.com> on 2015/03/13 07:37:25 UTC

Parsing error on space

Hi,

I want to retrieve the parent document which contain "Test Street" in street
field or if any of it's child contain "Test Street" in childStreet field.
So, I've used the following syntax.
q=street:"Test Street" OR {!parent which="type:parent"}childStreet:"Test
Street"

If the query after the OR condition is a parent query it's not executing.
I'm getting the records based on the first query alone. So, I tried using
the filter query as below.
 
q="*:*"&fq=street:"Test Street" OR {!parent
which="type:parent"}childStreet:"Test Street". This query retrieves records
based on both the condition, but when the query string contains multiple
words like "Test Street" I'm getting EOF exception and it's not parsing due
to space.

Any approach to overcome this.

Thanks in advance
Rajesh





--
View this message in context: http://lucene.472066.n3.nabble.com/Parsing-error-on-space-tp4192796.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Parsing error on space

Posted by Jack Krupansky <ja...@gmail.com>.
First, as a general rule you must escape spaces in URL query parameters,
either as a plus sign or "%20".

That said, I suspect that the code that extracts nested queries is stopping
at the space.

Try escaping the space with a backslash.

Then you could try replacing the space in the nested query term with
"\u0020".


-- Jack Krupansky

On Fri, Mar 13, 2015 at 2:37 AM, Rajesh <ra...@aspiresys.com>
wrote:

> Hi,
>
> I want to retrieve the parent document which contain "Test Street" in
> street
> field or if any of it's child contain "Test Street" in childStreet field.
> So, I've used the following syntax.
> q=street:"Test Street" OR {!parent which="type:parent"}childStreet:"Test
> Street"
>
> If the query after the OR condition is a parent query it's not executing.
> I'm getting the records based on the first query alone. So, I tried using
> the filter query as below.
>
> q="*:*"&fq=street:"Test Street" OR {!parent
> which="type:parent"}childStreet:"Test Street". This query retrieves records
> based on both the condition, but when the query string contains multiple
> words like "Test Street" I'm getting EOF exception and it's not parsing due
> to space.
>
> Any approach to overcome this.
>
> Thanks in advance
> Rajesh
>
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Parsing-error-on-space-tp4192796.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>