Solr存储库类
@Repository
public interface PoctestRepository extends SolrCrudRepository<Poctest, String> {
@Override
Page<Poctest> findAll(Pageable pageable);
@Query("id:*?0* OR company:*?0* OR college:*?0* OR name:*?0* OR address:*?0* OR dob:*?0* OR age:*?0*" )
public Page<Poctest> search(String searchTerm, Pageable pageable);
}
Solr文档数据类
@SolrDocument(solrCoreName = "poctest")
@Data
public class Poctest {
@Id
@Indexed(name = "id", type = "string")
private String id;
@Indexed(name = "name", type = "string")
private String name;
@Indexed(name = "address", type = "string")
private String address;
@Indexed(name = "college", type = "string")
private String college;
@Indexed(name = "company", type = "string")
private String company;
@Indexed(name = "dob", type = "pint")
private String dob;
@Indexed(name = "age", type = "pint")
private String age;
}
需要澄清: