Hi Gora.

My apologizes for this subject. It wasn't my intention to be rude or
something like that.

As I said about mapping database columns with solr fields, it works in
mysql. Maybe I'm wrong with some config file because I'm new with Solr. By
the way, it is a great product.

But I've just tried about sub-entities using mysql. And all work perfect.
It shows me that I am doing something wrong with Oracle database at work.

I attach with this mail files I used with mysql. Mapping columns is OK,
sub-entities is OK.

Thanks so much for your opinion.

Kinds regards

Rafael

db-data-config.xml
<dataConfig>
    <dataSource driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/solr" user="solr" password="solr" />
    <document>
        <entity name="usuario" query="select idusuario,nombres,apellidos
from usuario">
            <field column="idusuario" name="idusuario" />
            <field column="nombres" name="nombres111" />
            <field column="apellidos" name="apellidos111" />
               <entity name="documento" query="select iddocumento,nombre
from documento where usuario_idusuario = '${usuario.idusuario}'">
                  <field column="iddocumento" name="iddocumento" />
                  <field column="nombre" name="nombredocumento" />
               </entity>
        </entity>
    </document>
</dataConfig>

schema.xml
<?xml version="1.0" encoding="UTF-8" ?>
<schema name="db" version="1.1">
  <types>
    <fieldType name="string" class="solr.StrField" sortMissingLast="true"
omitNorms="true"/>
    <fieldType name="sint" class="solr.SortableIntField"
sortMissingLast="true" omitNorms="true"/>
 </types>

 <fields>
   <field name="idusuario" type="sint" indexed="true" stored="true"
required="true" />
   <field name="nombres111" type="string" indexed="true" stored="true" />
   <field name="apellidos111" type="string" indexed="true" stored="true"/>
   <field name="iddocumento" type="string" indexed="true" stored="true"/>
   <field name="nombredocumento" type="string" indexed="true"
stored="true"/>
 </fields>

 <!-- Field to use to determine and enforce document uniqueness.
      Unless this field is marked with required="false", it will be a
required field
   -->
 <uniqueKey>idusuario</uniqueKey>

 <!-- field for the QueryParser to use when an explicit fieldname is absent
-->
 <defaultSearchField>nombres111</defaultSearchField>

 <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
 <solrQueryParser defaultOperator="OR"/>

</schema>

solrconfig.xml
<?xml version="1.0" encoding="UTF-8" ?>
<config>
  <luceneMatchVersion>LUCENE_36</luceneMatchVersion>
  <!--  The DirectoryFactory to use for indexes.
        solr.StandardDirectoryFactory, the default, is filesystem based.
        solr.RAMDirectoryFactory is memory based, not persistent, and
doesn't work with replication. -->
  <directoryFactory name="DirectoryFactory"
class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>


  <updateHandler class="solr.DirectUpdateHandler2" />

  <requestDispatcher handleSelect="true" >
    <requestParsers enableRemoteStreaming="false"
multipartUploadLimitInKB="2048" />
  </requestDispatcher>

  <requestHandler name="standard" class="solr.StandardRequestHandler"
default="true" />
  <requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />
  <requestHandler name="/admin/"
class="org.apache.solr.handler.admin.AdminHandlers" />
  <requestHandler name="/dataimport"
class="org.apache.solr.handler.dataimport.DataImportHandler">
    <lst name="defaults">
    <str name="config">db-data-config.xml</str>
    </lst>
  </requestHandler>
  <!-- config for the admin interface -->
  <admin>
    <defaultQuery>solr</defaultQuery>
  </admin>

</config>



On Mon, Jun 4, 2012 at 12:31 PM, Gora Mohanty <g...@mimirtech.com> wrote:

> On 4 June 2012 22:27, Rafael Taboada <kaliman.fore...@gmail.com> wrote:
> >
> > Hi folks,
> >
> > I've just solved using outer joins like this:
> >
> > <entity name="documento" query="SELECT
> > d.iddocumento,d.nrodocumento,td.idtipodocumento,td.nombre AS
> > nombretipodocumento FROM documento d LEFT OUTER JOIN tipodocumento td ON
> > (d.tipodocumento = td.idtipodocumento)">
> >         <field column="iddocumento" name="iddocumento" />
> >         <field column="nrodocumento" name="nrodocumento" />
> >         <field column="idtipodocumento" name="idtipodocumento" />
> >         <field column="nombretipodocumento" name="nombretipodocumento" />
> >
> > Any idea why I can't index using sub-entities?
> [...]
>
> Dear Rafael,
>
> No offence meant, but please take a look at
> http://wiki.apache.org/solr/UsingMailingLists
> This is by no means meant to discourage you
> from asking questions on this list, but to
> request due diligence from your side so that
> people can help you better.
>
> In this particular case, given that you have
> changed your top-level SELECT, you might
> wish to inform people about whether you have
> made corresponding changes for sub-entities.
>
> Have you tried out the various SELECT
> statements in the entity, and sub-entity,
> outside of Solr, to ensure that they provide
> results?
>
> Again, with due respect, it is unlikely that
> a now-mature product like Solr has issues
> like what you have been asking about, e.g.:
> - Mapping column names to Solr field
>  names
> - Having sub-entities indexed properly.
> At least from personal experience, we have
> worked with both of these use cases without
> any issues. Thankfully, Oracle was not
> involved in our processes, but it would be
> difficult to imagine that there is an issue
> with Oracle in this regard.
>
> Regards,
> Gora
>



-- 
Rafael Taboada

/*
 * Phone >> 992 741 026
 */

Reply via email to