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 andreic9203 <an...@gmail.com> on 2014/11/03 08:25:52 UTC
SOLRJ - query with ChildDocTransformerFactory
Hello,
I have a little problem.
In Solr index I have a lot of nested documents. I figured out the query for
fetching the childrens which is the following:
Nested doc example:
<doc>
<field name="id">1</field>
<field name="name">I am the parent</field>
<field name="cat">PARENT</field>
<doc>
<field name="id">1.1</field>
<field name="name">I am the 1st child</field>
<field name="cat">CHILD</field>
</doc>
</doc>
q={!parent which=id:"1"}
fl=[child parentFilter="cat:PARENT" childFilter="cat:CHILD"]
I use it into a browser, and as it was expected, it returns only my childs.
Perfect!
But when I use it with SOLRJ, the library appends to the query link the
following part:
&wt=javabin&version=2
and even the browser crash with this URL. If I remove the part with javabin
and with version from the URL, it works.
I've found a workaround, casting the solrServer to HttpSolrServer and I've
used the setParser to set XMLResponseParser to be the default solr parser,
but it is very slowly.
Could anyone tell me how to solve this problem and in this time to keep the
javabin parser?
Thank you very much,
Andrei
--
View this message in context: http://lucene.472066.n3.nabble.com/SOLRJ-query-with-ChildDocTransformerFactory-tp4167183.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: SOLRJ - query with ChildDocTransformerFactory crash because of
the javabin parser
Posted by Erick Erickson <er...@gmail.com>.
bq: Was a little, let's say mistake, in my query
Been there, done that ;) Thanks for closing this out.
Best,
Erick
On Mon, Nov 3, 2014 at 3:25 AM, andreic9203 <an...@gmail.com> wrote:
> Hello,
>
> And to answer to my question...:D
>
> Was a little, let's say mistake, in my query.
> Instead of
> fl=[child parentFilter="cat:PARENT" childFilter="cat:CHILD"]
> should be
> fl=id,[child parentFilter="cat:PARENT" childFilter="cat:CHILD"]
>
> Awkward, because if you put the query and the filter in URL or in the solr
> queries tool, both methods works very well. But when you want to make the
> query from java, with Solrj, the library appends that parser section, and it
> crashes if it cannot find parent fields in the results.
>
> Instead of the id, you could put what field name do you want from the
> parent.
>
> Regards,
> Andrei
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/SOLRJ-query-with-ChildDocTransformerFactory-crash-because-of-the-javabin-parser-tp4167183p4167218.html
> Sent from the Solr - User mailing list archive at Nabble.com.
Re: SOLRJ - query with ChildDocTransformerFactory crash because of
the javabin parser
Posted by andreic9203 <an...@gmail.com>.
Hello,
And to answer to my question...:D
Was a little, let's say mistake, in my query.
Instead of
fl=[child parentFilter="cat:PARENT" childFilter="cat:CHILD"]
should be
fl=id,[child parentFilter="cat:PARENT" childFilter="cat:CHILD"]
Awkward, because if you put the query and the filter in URL or in the solr
queries tool, both methods works very well. But when you want to make the
query from java, with Solrj, the library appends that parser section, and it
crashes if it cannot find parent fields in the results.
Instead of the id, you could put what field name do you want from the
parent.
Regards,
Andrei
--
View this message in context: http://lucene.472066.n3.nabble.com/SOLRJ-query-with-ChildDocTransformerFactory-crash-because-of-the-javabin-parser-tp4167183p4167218.html
Sent from the Solr - User mailing list archive at Nabble.com.