How to patch Solr4.2 for SolrEnityProcessor Sub-Enity issue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How to patch Solr4.2 for SolrEnityProcessor Sub-Enity issue

harshchawla
This post was updated on .
According to http://stackoverflow.com/questions/15734308/solrentityprocessor-is-called-only-once-for-sub-entities?lq=1 we can use the patched SolrEntityProcessor in https://issues.apache.org/jira/browse/SOLR-3336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel to solve the subentity problem.

As per the post I tried updating the dataimport handler jar file of solr4.2 and tried by renaming the jar file to zip and then try replacing the patched file but as I got only java file I can't replace it with class file. So I drop this idea.

Here is then what I have tried. I decompiled the original jar solr-dataimporthandler-4.2.0.jar present in solr 4.2 package. Then I replace the patch file. And try to compile the files for making the jar again. But I started getting compilation errors.

.\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:397: ')' expected

/* 432 / if (XPathEntityProcessor.2.this.val$isEnd.get()) { ^ .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:397: expected / 432 / if (XPathEntityProcessor.2.this.val$isEnd.get()) { ^ .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:397: not a statem ent / 432 / if (XPathEntityProcessor.2.this.val$isEnd.get()) { ^ .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:397: illegal star t of expression / 432 */ if (XPathEntityProcessor.2.this.val$isEnd.get()) { ^ .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:397: ';' expected

/* 432 */ if (XPathEntityProcessor.2.this.val$isEnd.get()) { ^ .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:397: ';' expected

/* 432 / if (XPathEntityProcessor.2.this.val$isEnd.get()) { ^ .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:398: not a statem ent / 433 */ XPathEntityProcessor.2.this.val$throwExp.set(false); ^ .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:398: ';' expected

/* 433 / XPathEntityProcessor.2.this.val$throwExp.set(false); ^ .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:406: not a statem ent / 442 */ XPathEntityProcessor.2.this.val$isEnd.set(true); ^ .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:406: ';' expected

/* 442 / XPathEntityProcessor.2.this.val$isEnd.set(true); ^ .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:409: not a statem ent / 445 */ XPathEntityProcessor.2.this.offer(row); ^ .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:409: ';' expected

/* 445 */ XPathEntityProcessor.2.this.offer(row); ^ 12 errors

Any idea how to patch Solr4.2 for this issue.

I thought it must be in Sol4.4 but it is not in it. Any help on this.
Reply | Threaded
Open this post in threaded view
|

Re: How to patch Solr4.2 for SolrEnityProcessor Sub-Enity issue

Shalin Shekhar Mangar
That issue was fixed in Solr 3.6 and 4.0-alpha. The latest Solr
releases already have that fix. Can you give more details on why you
think you are still affected by that bug?

On Fri, Aug 23, 2013 at 4:29 PM, harshchawla <[hidden email]> wrote:

> According to
> http://stackoverflow.com/questions/15734308/solrentityprocessor-is-called-only-once-for-sub-entities?lq=1
> we can use the patched SolrEntityProcessor in
> https://issues.apache.org/jira/browse/SOLR-3336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel
> to solve the subentity problem.
>
> I tried renaming the jar file to zip and then try replacing the patched file
> but as I got only java file I can't replace it with class file. So I drop
> this idea.
>
> Here is then what I have tried. I decompiled the original jar
> solr-dataimporthandler-4.2.0.jar present in solr 4.2 package. Then I replace
> the patch file. And try to compile the files for making the jar again. But I
> started getting compilation errors.
>
> .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:397: ')'
> expected
>
> /* 432 / if (XPathEntityProcessor.2.this.val$isEnd.get()) { ^
> .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:397: expected
> / 432 / if (XPathEntityProcessor.2.this.val$isEnd.get()) { ^
> .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:397: not a
> statem ent / 432 / if (XPathEntityProcessor.2.this.val$isEnd.get()) { ^
> .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:397: illegal
> star t of expression / 432 */ if
> (XPathEntityProcessor.2.this.val$isEnd.get()) { ^
> .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:397: ';'
> expected
>
> /* 432 */ if (XPathEntityProcessor.2.this.val$isEnd.get()) { ^
> .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:397: ';'
> expected
>
> /* 432 / if (XPathEntityProcessor.2.this.val$isEnd.get()) { ^
> .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:398: not a
> statem ent / 433 */ XPathEntityProcessor.2.this.val$throwExp.set(false); ^
> .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:398: ';'
> expected
>
> /* 433 / XPathEntityProcessor.2.this.val$throwExp.set(false); ^
> .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:406: not a
> statem ent / 442 */ XPathEntityProcessor.2.this.val$isEnd.set(true); ^
> .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:406: ';'
> expected
>
> /* 442 / XPathEntityProcessor.2.this.val$isEnd.set(true); ^
> .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:409: not a
> statem ent / 445 */ XPathEntityProcessor.2.this.offer(row); ^
> .\org\apache\solr\handler\dataimport\XPathEntityProcessor.java:409: ';'
> expected
>
> /* 445 */ XPathEntityProcessor.2.this.offer(row); ^ 12 errors
>
> Any idea how to patch Solr4.2 for this issue.
>
> I thought it must be in Sol4.4 but it is not in it. Any help on this.
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-to-patch-Solr4-2-for-SolrEnityProcessor-Sub-Enity-issue-tp4086292.html
> Sent from the Solr - User mailing list archive at Nabble.com.



--
Regards,
Shalin Shekhar Mangar.
Reply | Threaded
Open this post in threaded view
|

Re: How to patch Solr4.2 for SolrEnityProcessor Sub-Enity issue

harshchawla
In the second reply of this link, it is discussed and more over I am facing the same issue here: http://stackoverflow.com/questions/15734308/solrentityprocessor-is-called-only-once-for-sub-entities?lq=1.

See attached my data-config.xml of new core (let say) test
<entity name="can" dataSource="dsms" query="select candidateid from Candidate c">
                                <field column="CandidateID" name="candidateid "/>
                <entity name="dt" processor="SolrEntityProcessor" url="http://localhost:8983/solr/csearch" query="candidateid :${can.CandidateID}" fl="*">                               
                                </entity>
                                <entity name="psu" dataSource="dsms" query="select Value from [CandidateData] where candidateid=${can.CandidateID}">
                                <field column="Value" name="psu"/>
                                </entity>
</entity>

Here only the first record is getting parsed properly otherwise for all the remaining records only two field are coming in new core test even though core "csearch" contains all the field values for all the records.

I hope it clarifies my situation more,
Reply | Threaded
Open this post in threaded view
|

Re: How to patch Solr4.2 for SolrEnityProcessor Sub-Enity issue

Shalin Shekhar Mangar
You are right. The fix committed to source was not complete. I've
reopened SOLR-3336 and I will put up a test and fix.

https://issues.apache.org/jira/browse/SOLR-3336

On Mon, Aug 26, 2013 at 9:41 AM, harshchawla <[hidden email]> wrote:

> In the second reply of this link, it is discussed and more over I am facing
> the same issue here:
> http://stackoverflow.com/questions/15734308/solrentityprocessor-is-called-only-once-for-sub-entities?lq=1.
>
> See attached my data-config.xml of new core (let say) test
> <entity name="can" dataSource="dsms" query="select candidateid from
> Candidate c">
>                                 <field column="CandidateID"
> name="candidateid "/>
>                                 <entity name="dt" processor="SolrEntityProcessor"
> url="http://localhost:8983/solr/csearch" query="candidateid
> :${can.CandidateID}" fl="*">
>                                 </entity>
>                                 <entity name="psu" dataSource="dsms"
> query="select Value from [CandidateData] where
> candidateid=${can.CandidateID}">
>                                         <field column="Value" name="psu"/>
>                                 </entity>
> </entity>
>
> Here only the first record is getting parsed properly otherwise for all the
> remaining records only two field are coming in new core test even though
> core "csearch" contains all the field values for all the records.
>
> I hope it clarifies my situation more,
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-to-patch-Solr4-2-for-SolrEnityProcessor-Sub-Enity-issue-tp4086292p4086564.html
> Sent from the Solr - User mailing list archive at Nabble.com.



--
Regards,
Shalin Shekhar Mangar.
Reply | Threaded
Open this post in threaded view
|

Re: How to patch Solr4.2 for SolrEnityProcessor Sub-Enity issue

harshchawla
Thanks a lot in advance. I am eagerly waiting for your response.
Reply | Threaded
Open this post in threaded view
|

Re: How to patch Solr4.2 for SolrEnityProcessor Sub-Enity issue

Shalin Shekhar Mangar
This is fixed in trunk and branch_4x and will be available in the next
release (4.5)

See https://issues.apache.org/jira/browse/SOLR-5190

On Mon, Aug 26, 2013 at 12:37 PM, harshchawla <[hidden email]> wrote:
> Thanks a lot in advance. I am eagerly waiting for your response.
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-to-patch-Solr4-2-for-SolrEnityProcessor-Sub-Enity-issue-tp4086292p4086572.html
> Sent from the Solr - User mailing list archive at Nabble.com.



--
Regards,
Shalin Shekhar Mangar.
Reply | Threaded
Open this post in threaded view
|

Re: How to patch Solr4.2 for SolrEnityProcessor Sub-Enity issue

harshchawla
Thanks a lot for this fix. I am now eagerly waiting for solr - 4.5