On 6 June 2013 00:09, Stavros Delisavas <stav...@delisavas.de> wrote:
>
> Thanks so far.
>
> This change makes Solr work over the title-entries too, yay! Unfortunatly
> they don't get processed(skipped rows). In my log it says
> "missing required field id" for every entry.
>
> I checked my schema.xml. In there "id" is not set as a required field.
> removing the uniquekey-property also leads to no improvement.
[...]

There are several things wrong with your problem statement.
You say that you have two tables, but both SELECTs seem
to use the same table. I am going to assume that you really
have two different tables.

Unless you have changed the default schema.xml, "id" should
be defined as the uniqueKey for the document. You probably
do not want to remove that, and even if you just remove the
uniqueKey property, the field "id" remains defined as a required
field.

The issue is with with your SELECT for the second entity:
<entity name="title" query="SELECT id AS titleid, title FROM name"></entity>
This renames "id" to titleid, and hence the required field
"id" in schema.xml is missing.

While you do need something like:
<document>
      <entity name="name" query="SELECT id, name FROM name1"></entity>
      <entity name="title" query="SELECT id, title FROM name2"></entity>
</document>

However, you will need to ensure that the ids are unique
in the two tables, else entries from the second entity will
overwrite matching ids from the first.

Also, do you have field definitions within the entities? Please
share the complete schema.xml and the DIH configuration
file with us, rather than snippets: Use pastebin.com if they
are large.

Regards,
Gora

Reply via email to