【发布时间】:2016-05-13 22:20:41
【问题描述】:
我有一个名为 Node 的类,我想使用 Solr Beans 功能将所有 Node 对象数据发送到 solr。
我已经在 schema.xml 中定义了所有字段,但是有一个(字段 description)没有在 solr 中被索引,我不明白为什么。 p>
我的班级(模型):
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;
}
索引节点对象:
SolrClient solrClient = new HttpSolrClient(url);
solrClient.addBeans(Node.find.all());
solrClient.commit(); //try catchs ...
我在 schema.xml 中的字段
<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"/>
有人可以检测到这里的错误吗?
【问题讨论】:
-
为清楚起见,请为其他注释添加导入。