java - How create a new FieldType in solr schema.xml -
i'm new solr, i'm developing application thesis, kind of search semantic engine ,i use springsource, (something siri or s-voice). use springsource , solr indexing documents,but have problem fieldtype. schema requires custom model (not class string parameter):
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; }
i have problem arraylist semantic use custom class wrote. question is: how create custom fieldtype add solr schema.xml. if start code error :solr error unknown field semantic. , not work. can me?
please refer following links guidance on modifying solr schema.
Comments
Post a Comment