Spring-data-solr config -
i met problem in studying spring data solr,this configuration class:
@configuration @enablesolrrepositories(basepackages={"cn.likefund.solr.repository"}, multicoresupport=true) public class solrcontext { static final string solr_host = "http://192.168.11.157:8080/solr"; @bean public solrclient solrclient() { return new httpsolrclient(solr_host); } }
and repository:
package cn.likefund.solr.repository; import java.util.list; import org.springframework.data.solr.repository.solrcrudrepository; import cn.likefund.solr.model.activity; public interface activityrepository extends solrcrudrepository<activity, string>{ list<activity> findbyname(string name); }
when start application,the message in console this
when delete method findbyname in repository,the application start no problem, want method findbyname worked,anybody know should problem?
here activity class:
@entity @solrdocument(solrcorename ="core_activity") public class activity implements serializable{ private static final long serialversionuid = 1566434582540525979l; @id @field(value = "id") private string id; @field(value = "createdt") private string createdt; @indexed @field(value = "name") private string name; public string getid() { return id; } public void setid(string id) { this.id = id; } public string getcreatedt() { return createdt; } public void setcreatedt(string createdt) { this.createdt = createdt; } public string getname() { return name; } public void setname(string name) { this.name = name; } }
so, crudrepository not created .
when delete findbyname, can manually query repo ? (just sure problem comes method, , not solr schema)
have tried annotate annotate method explicitly set query ? like
@query("name:?0") list findbyname(string name);
Comments
Post a Comment