elasticsearch query: start the project being given No property ... found for ... Did you mean '...'?

Find online case is:

Entity class field definitions:
Private String sku_no;
DAO interfaces were defined:
Goods findBySkuNo (String skuNo);
the Spring-defined in accordance with the Data interface method name (the default is considered to hump writing) skuNo to find the corresponding entity class field, when not found when, on the error:
org.springframework.data.mapping.PropertyReferenceException:! No Property skuNo of the type found for Goods Did you Mean 'sku_no'?
the Spring-dao in the Data specifications findBy ***, field names and entities must be consistent such findByUdateTime, entities will have to be private String udateTime; entity name field can not be sku_no this format, the specification does not meet the hump.

 

I started the project being given the name found for Property No EsProduct

Because findByNameOrSubTitleOrKeywords interface is not used nor commented, changed entity class

/ ** 
* commodity ES operating class
* the Created by Macro ON 2018/6/19.
* /
Public interface EsProductRepository the extends ElasticsearchRepository <EsProduct, Long> {
/ **
* check
*
* @param name Product name
* @param subTitle goods title
* @param keywords commodities keyword
* @param Page pagination information
* @return * / Page <EsProduct> findByNameOrSubTitleOrKeywords (String name, String subTitle, String keywords, the Pageable Page); } and my EsProduct entity is not a class name




/**
* 搜索中的商品信息
* Created by macro on 2018/6/19.
*/
@Document(indexName = "pms", type = "product",shards = 1,replicas = 0)
public class EsProduct implements Serializable {
private static final long serialVersionUID = -1L;
@Id
private Long id;
@Field(type = FieldType.Keyword)
private String productSn;
private Long brandId;
@Field(type = FieldType.Keyword)
private String brandName;
private Long productCategoryId;
@Field(analyzer = "ik_max_word",type = FieldType.Text)
private String productName;
@Field(analyzer = "ik_max_word",type = FieldType.Text)
private String subTitle;
private BigDecimal price;
@Field(analyzer = "ik_max_word",type = FieldType.Text)
private String keywords;

@Field(type =FieldType.Nested)
private List<EsProductAttribute> attriList;

@Field(type =FieldType.Nested)
private EsProductCategory productCategorie;
Resulting in an error

 

Guess you like

Origin www.cnblogs.com/javawxid/p/10966814.html