0

列名「TR.nom」とは異なるsolrフィールド名でデータベースにインデックスを付けたい:

<entity name="id" query="select R.id, R.titre, R.description, TR.nom
                            from Ressource as R
                            join TypeRessource as TR
                            on R.typeRessource_id = TR.id">
<field column="R.id" name="id" />
    <field column="R.titre" name="titre" />
    <field column="R.description" name="description" />
    <field column="TR.nom" name="typeRessource" />
</entity>

schema.xml内:

<field name="typeRessource" type="text" indexed="true" stored="true" />

インデックス作成はすべてのフィールドで正常に機能しますが、「typeRessource」では機能しません。

フィールド名が列名と同じであれば問題ありません。

ご協力いただきありがとうございます

4

1 に答える 1

1

You can always use AS on your sql query to make the column name match the solr field name
in your case :

select R.id, R.titre, R.description, TR.nom AS typeRessource
from Ressource as R
join TypeRessource as TR
on R.typeRessource_id = TR.id
于 2012-12-04T16:35:46.263 に答える