赞
踩
关键词 es 匹配 满足条件返回id集合 --> 通过id集合,查询mysql/mongodb数据库得到数据列表
设计domain 想当于在Elasticsearch中创建需全文查询的库和表
/** * 目的地搜索对象 */ @Getter @Setter @Document(indexName="wolf2w_destination",type="destination") public class DestinationEs implements Serializable { public static final String INDEX_NAME = "wolf2w_destination"; public static final String TYPE_NAME = "destination"; @Id //@Field 每个文档的字段配置(类型、是否分词、是否存储、分词器 ) @Field(store=true, index = false,type = FieldType.Keyword) private String id; //攻略id @Field(index=true,store=true,type = FieldType.Keyword) private String name; @Field(index=true,analyzer="ik_max_word",store=true,searchAnalyzer="ik_max_word",type = FieldType.Text) private String info; } ----------------------------------------------------------------------- /** * 游记搜索对象 */ @Getter @Setter @Document(indexName="wolf2w_travel",type="travel") public class TravelEs implements Serializable { public static final String INDEX_NAME = "wolf2w_travel"; public static final String TYPE_NAME = "travel"; //@Field 每个文档的字段配置(类
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。