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 Rakesh Sinha <ra...@gmail.com> on 2008/12/29 19:36:29 UTC

DataImportHandler - The field :xyz present in DataConfig does not have a counterpart in Solr Schema

Hi -
  I am testing around with the full - import functionality of Data
Import Handler.  My dataconfig file looks as follows.


<dataConfig>
    <dataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://myserver/mydb"
        user="username" password="password" />
    <document name="user">
        <entity name="item"
            query="select id, firstname, lastname from user">
            <field column="id" />
            <field column="firstname" />
            <field column="lastname" />
        </entity>
    </document>
</dataConfig>

In solrconfig.xml - I am setting the access for DIH as follows.

  <requestHandler name="/dataimport"
class="org.apache.solr.handler.dataimport.DataImportHandler">
    <lst name="defaults">
      <str name="config">data-config.xml</str>
    </lst>
  </requestHandler>


When I try to access the deployed web-app ( even before hitting
full-import functionality using command ) - I am getting the following
sequence of errors.

The field :lastname present in DataConfig does not have a counterpart
in Solr Schema
The field :firstname present in DataConfig does not have a counterpart
in Solr Schema

The config file is very similar to what is given in the DIH wiki.

Curious, what gives ?

Re: DataImportHandler - The field :xyz present in DataConfig does not have a counterpart in Solr Schema

Posted by Rakesh Sinha <ra...@gmail.com>.
Oops. The fields were out of sync with those in schema.xml .

Looking at the dynamic field name configuration in schema.xml - my
dataconfig.xml file looks as follows.


<dataConfig>
    <dataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://myserver/mydb"
        user="username" password="password" />
    <document name="user">
        <entity name="item"
            query="select id, firstname, lastname from user">
            <field column="id"  name="id" />
            <field column="firstname" name="firstname_s" />
            <field column="lastname" name="lastname_s" />
        </entity>
    </document>
 </dataConfig>

The naming of fields with suffix ( _s ) , as per the dynamic field
naming conventions fixed the issue.



On Mon, Dec 29, 2008 at 1:36 PM, Rakesh Sinha <ra...@gmail.com> wrote:
> Hi -
>  I am testing around with the full - import functionality of Data
> Import Handler.  My dataconfig file looks as follows.
>
>
> <dataConfig>
>    <dataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://myserver/mydb"
>        user="username" password="password" />
>    <document name="user">
>        <entity name="item"
>            query="select id, firstname, lastname from user">
>            <field column="id" />
>            <field column="firstname" />
>            <field column="lastname" />
>        </entity>
>    </document>
> </dataConfig>
>
> In solrconfig.xml - I am setting the access for DIH as follows.
>
>  <requestHandler name="/dataimport"
> class="org.apache.solr.handler.dataimport.DataImportHandler">
>    <lst name="defaults">
>      <str name="config">data-config.xml</str>
>    </lst>
>  </requestHandler>
>
>
> When I try to access the deployed web-app ( even before hitting
> full-import functionality using command ) - I am getting the following
> sequence of errors.
>
> The field :lastname present in DataConfig does not have a counterpart
> in Solr Schema
> The field :firstname present in DataConfig does not have a counterpart
> in Solr Schema
>
> The config file is very similar to what is given in the DIH wiki.
>
> Curious, what gives ?
>

Re: DataImportHandler - The field :xyz present in DataConfig does not have a counterpart in Solr Schema

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
These are warning messages . They do not stop anything in DIH
It is very common that users make typos and that may be hard to debug.
So the messages are spit out

On Tue, Dec 30, 2008 at 12:06 AM, Rakesh Sinha <ra...@gmail.com> wrote:
> Hi -
>  I am testing around with the full - import functionality of Data
> Import Handler.  My dataconfig file looks as follows.
>
>
> <dataConfig>
>    <dataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://myserver/mydb"
>        user="username" password="password" />
>    <document name="user">
>        <entity name="item"
>            query="select id, firstname, lastname from user">
>            <field column="id" />
>            <field column="firstname" />
>            <field column="lastname" />
>        </entity>
>    </document>
> </dataConfig>
>
> In solrconfig.xml - I am setting the access for DIH as follows.
>
>  <requestHandler name="/dataimport"
> class="org.apache.solr.handler.dataimport.DataImportHandler">
>    <lst name="defaults">
>      <str name="config">data-config.xml</str>
>    </lst>
>  </requestHandler>
>
>
> When I try to access the deployed web-app ( even before hitting
> full-import functionality using command ) - I am getting the following
> sequence of errors.
>
> The field :lastname present in DataConfig does not have a counterpart
> in Solr Schema
> The field :firstname present in DataConfig does not have a counterpart
> in Solr Schema
>
> The config file is very similar to what is given in the DIH wiki.
>
> Curious, what gives ?
>



-- 
--Noble Paul