2016-05-13 7 views
0

私はクラスをノードといい、Solr Beansの機能を使ってすべてのNodeオブジェクトデータをsolrに送信したいと思います。Solr Beanフィールドが機能しない

私はすでにのschema.xmlにすべてのフィールドを定義していたが、Solrのではインデックスが作成されていないもの(フィールド説明)があると、私は理由を理解いけません。

私のクラス(モデル):

import com.avaje.ebean.Model; 
import org.apache.solr.client.solrj.beans.Field; 
public class Node extends Model { 
    @Id 
    @Field("id) 
    public long id; 

    @Constraints.Required 
    @Field("code") 
    public String code; 

    @Field("name") 
    public String name; 

    @Lob //support big strings (bigger than varchar(255) in db 
    @Field("description") 
    public String description; 
} 

インデックスノードオブジェクト:のschema.xmlで

SolrClient solrClient = new HttpSolrClient(url); 
solrClient.addBeans(Node.find.all()); 
solrClient.commit(); //try catchs ... 

私のフィールド

<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" /> 
<field name="_version_" type="long" indexed="true" stored="false"/> 
<field name="antecessorNodeCode" type="text_pt" indexed="false" stored="true" multiValued="false"/> 
<field name="code" type="text_pt" indexed="true" stored="true" multiValued="false"/> 
<field name="name" type="text_pt" indexed="true" stored="true" multiValued="false"/> 
<field name="description" type="text_pt" indexed="true" stored="true" multiValued="false"/> 
<field name="includeEvents" type="text_pt" indexed="true" stored="true" multiValued="true"/> 
<field name="excludeEvents" type="text_pt" indexed="true" stored="true" multiValued="true"/> 

誰かがここでエラーを検出できますか?

+0

明瞭にするために、他の注釈のインポートを追加してください。 –

答えて

0

エラーが発生しました。 BLOB(@Lob)をtype="text_ptのフィールドに保存しようとしていましたが、そのタイプは異なります。 BLOB(バイナリ)をサポートするフィールドを作成するか、db @Column(length = 750)の大きな文字列を受け入れて、同じフィールドタイプにとどまることができます。

関連する問題