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 sanjay92 <sa...@hotmail.com> on 2014/04/03 18:30:21 UTC

Solr DataImport Hander

Hi,
I am writing very simple Dept, Emp Solr DataImport Handler. it is working
but when I query using http://localhost:8983/solr/select?q=*:*
I see results in XML format . See attached file.
deptemp.xml <http://lucene.472066.n3.nabble.com/file/n4128911/deptemp.xml>  

Output from inner query does not correctly formatted to show : For each
Dept, There are number of employees ( I want to show emp name and JOb) . I
want to show first ename,Job as 1 row  but it is showing all emp name first
and after that another column for Job.
Do I to do any changes in schema.xml for proper display ?

-------------------------------------



data-config.xml looks like this:
<dataConfig>
  <dataSource type="JdbcDataSource"
              driver="oracle.jdbc.driver.OracleDriver"
              url="jdbc:oracle:thin:@mydb:1521:SID"
              user="*****"
              password="*****"  />
  <document>
    <entity name="mydept"  query="select deptno,dname,loc from dept">
            <field column="DEPTNO" name="deptno" />
            <field column="DNAME" name="dname" />
            <field column="LOC" name="loc" />
            <entity name="myemp" query="select ename,job from emp where
deptno=${mydept.DEPTNO} " >
               <field column="ENAME" name="ename" />
               <field column="JOB" name="job" />
            </entity>
    </entity>
  </document>
</dataConfig>




--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-DataImport-Hander-tp4128911.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr DataImport Hander

Posted by Ahmet Arslan <io...@yahoo.com>.
Hi Sanjay,

1) Change you SQL from "select ename,job from .." to "select concat(ename,job) as something from"

2) Use TemplateTransformer http://wiki.apache.org/solr/DataImportHandler#TemplateTransformer
  
<entity name="myemp" query="select ename,job from emp where
deptno=${mydept.DEPTNO}" transformer="TemplateTransformer" >
              <field column="ENAME" name="ename" />
              <field column="JOB" name="job" />
              <field column="namedesc" template="hello${myemp.ename},${myemp.job}" />
</entity> 


On Thursday, April 3, 2014 7:30 PM, sanjay92 <sa...@hotmail.com> wrote:
Hi,
I am writing very simple Dept, Emp Solr DataImport Handler. it is working
but when I query using http://localhost:8983/solr/select?q=*:*
I see results in XML format . See attached file.
deptemp.xml <http://lucene.472066.n3.nabble.com/file/n4128911/deptemp.xml>  

Output from inner query does not correctly formatted to show : For each
Dept, There are number of employees ( I want to show emp name and JOb) . I
want to show first ename,Job as 1 row  but it is showing all emp name first
and after that another column for Job.
Do I to do any changes in schema.xml for proper display ?

-------------------------------------



data-config.xml looks like this:
<dataConfig>
  <dataSource type="JdbcDataSource"
              driver="oracle.jdbc.driver.OracleDriver"
              url="jdbc:oracle:thin:@mydb:1521:SID"
              user="*****"
              password="*****"  />
  <document>
    <entity name="mydept"  query="select deptno,dname,loc from dept">
            <field column="DEPTNO" name="deptno" />
            <field column="DNAME" name="dname" />
            <field column="LOC" name="loc" />
            <entity name="myemp" query="select ename,job from emp where
deptno=${mydept.DEPTNO} " >
               <field column="ENAME" name="ename" />
               <field column="JOB" name="job" />
            </entity>
    </entity>
  </document>
</dataConfig>




--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-DataImport-Hander-tp4128911.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr DataImport Hander

Posted by Candygram For Mongo <ca...@gmail.com>.
The ramBufferSizeMB was set to 6MB only on the test system to make the
system crash sooner.  In production that tag is commented out which
I believe forces the default value to be used.


On Thu, Apr 3, 2014 at 6:36 PM, Susheel Kumar <
susheel.kumar@thedigitalgroup.net> wrote:

> Hi Sanjay,
>
> This is how output will come since solr documents are flat.  In  your sub
> entity you queried emp name for a dept and for e.g. in case of deptno=10
> you had 3 employees so all came in ename field.
>
> You are getting the data, now it will be your UI function to present in
> whatever format you are looking to display.  In this case if you can
> maintain the sequence meaning, first ename {0 indice} is for first job {0
> indice} you are good.
>
> Thanks,
> Susheel
>
> -----Original Message-----
> From: sanjay92 [mailto:sanjay92@hotmail.com]
> Sent: Thursday, April 03, 2014 12:30 PM
> To: solr-user@lucene.apache.org
> Subject: Solr DataImport Hander
>
> Hi,
> I am writing very simple Dept, Emp Solr DataImport Handler. it is working
> but when I query using http://localhost:8983/solr/select?q=*:*
> I see results in XML format . See attached file.
> deptemp.xml <http://lucene.472066.n3.nabble.com/file/n4128911/deptemp.xml>
>
> Output from inner query does not correctly formatted to show : For each
> Dept, There are number of employees ( I want to show emp name and JOb) . I
> want to show first ename,Job as 1 row  but it is showing all emp name first
> and after that another column for Job.
> Do I to do any changes in schema.xml for proper display ?
>
> -------------------------------------
>
>
>
> data-config.xml looks like this:
> <dataConfig>
>   <dataSource type="JdbcDataSource"
>               driver="oracle.jdbc.driver.OracleDriver"
>               url="jdbc:oracle:thin:@mydb:1521:SID"
>               user="*****"
>               password="*****"  />
>   <document>
>     <entity name="mydept"  query="select deptno,dname,loc from dept">
>             <field column="DEPTNO" name="deptno" />
>             <field column="DNAME" name="dname" />
>             <field column="LOC" name="loc" />
>             <entity name="myemp" query="select ename,job from emp where
> deptno=${mydept.DEPTNO} " >
>                <field column="ENAME" name="ename" />
>                <field column="JOB" name="job" />
>             </entity>
>     </entity>
>   </document>
> </dataConfig>
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-DataImport-Hander-tp4128911.html
> Sent from the Solr - User mailing list archive at Nabble.com.
> This e-mail message may contain confidential or legally privileged
> information and is intended only for the use of the intended recipient(s).
> Any unauthorized disclosure, dissemination, distribution, copying or the
> taking of any action in reliance on the information herein is prohibited.
> E-mails are not secure and cannot be guaranteed to be error free as they
> can be intercepted, amended, or contain viruses. Anyone who communicates
> with us by e-mail is deemed to have accepted these risks. Company Name is
> not responsible for errors or omissions in this message and denies any
> responsibility for any damage arising from the use of e-mail. Any opinion
> defamatory or deemed to be defamatory or  any material which could be
> reasonably branded to be a species of plagiarism and other statements
> contained in this message and any attachment are solely those of the author
> and do not necessarily represent those of the company.
>

RE: Solr DataImport Hander

Posted by Susheel Kumar <su...@thedigitalgroup.net>.
Hi Sanjay,

This is how output will come since solr documents are flat.  In  your sub entity you queried emp name for a dept and for e.g. in case of deptno=10 you had 3 employees so all came in ename field.

You are getting the data, now it will be your UI function to present in whatever format you are looking to display.  In this case if you can maintain the sequence meaning, first ename {0 indice} is for first job {0 indice} you are good.

Thanks,
Susheel

-----Original Message-----
From: sanjay92 [mailto:sanjay92@hotmail.com]
Sent: Thursday, April 03, 2014 12:30 PM
To: solr-user@lucene.apache.org
Subject: Solr DataImport Hander

Hi,
I am writing very simple Dept, Emp Solr DataImport Handler. it is working but when I query using http://localhost:8983/solr/select?q=*:*
I see results in XML format . See attached file.
deptemp.xml <http://lucene.472066.n3.nabble.com/file/n4128911/deptemp.xml>

Output from inner query does not correctly formatted to show : For each Dept, There are number of employees ( I want to show emp name and JOb) . I want to show first ename,Job as 1 row  but it is showing all emp name first and after that another column for Job.
Do I to do any changes in schema.xml for proper display ?

-------------------------------------



data-config.xml looks like this:
<dataConfig>
  <dataSource type="JdbcDataSource"
              driver="oracle.jdbc.driver.OracleDriver"
              url="jdbc:oracle:thin:@mydb:1521:SID"
              user="*****"
              password="*****"  />
  <document>
    <entity name="mydept"  query="select deptno,dname,loc from dept">
            <field column="DEPTNO" name="deptno" />
            <field column="DNAME" name="dname" />
            <field column="LOC" name="loc" />
            <entity name="myemp" query="select ename,job from emp where deptno=${mydept.DEPTNO} " >
               <field column="ENAME" name="ename" />
               <field column="JOB" name="job" />
            </entity>
    </entity>
  </document>
</dataConfig>




--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-DataImport-Hander-tp4128911.html
Sent from the Solr - User mailing list archive at Nabble.com.
This e-mail message may contain confidential or legally privileged information and is intended only for the use of the intended recipient(s). Any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is prohibited. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, or contain viruses. Anyone who communicates with us by e-mail is deemed to have accepted these risks. Company Name is not responsible for errors or omissions in this message and denies any responsibility for any damage arising from the use of e-mail. Any opinion defamatory or deemed to be defamatory or  any material which could be reasonably branded to be a species of plagiarism and other statements contained in this message and any attachment are solely those of the author and do not necessarily represent those of the company.