2
我是Solr的新手, 我正在爲我的論文開發一個應用程序,這是一種搜索語義引擎,我使用了springource(類似於siri或s-語音)。我使用springsource和Solr來索引我的文檔,但是我有一些fieldType的問題。我的架構需要一個自定義模式(不僅有字符串參數的類):如何在solr schema.xml中創建一個新的FieldType
public class IndexedObject{
private String id;
private ArrayList<String> features;
private ArrayList<Semantic> semantic;
private String score;
private String time;
private int status;
@XmlElement(name="time")
public String getTime() {
return time;
}
@Field
public void setTime(String time) {
this.time = time;
}
@XmlElement(name="status")
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
@XmlElement(name="score")
public String getScore() {
return score;
}
public void setScore(String score) {
this.score = score;
}
@XmlElement(name="id", required=true)
public String getId() {
return id;
}
@Field
public void setId(String id) {
this.id = id;
}
@XmlElementWrapper(name = "features")
@XmlElement(name = "feature")
public ArrayList<String> getFeatures() {
return features;
}
@Field
public void setFeatures(ArrayList<String> features) {
this.features = features;
}
@XmlElementWrapper(name = "semantics")
@XmlElement(name = "semantic")
public ArrayList<Semantic> getSemantic() {
return semantic;
}
@Field
public void setSemantic(ArrayList<Semantic> semantic) {
this.semantic = semantic;
}
我有使用,我寫了一個自定義類ArrayList的語義問題。 問題是:我如何創建自定義FieldType以添加到solr schema.xml。如果我開始我的代碼,我得到這個錯誤:solr錯誤未知字段語義。它不起作用。 任何人都可以幫助我嗎?