Fetch the repository succeeded.
This action will force synchronization from LD/LucenePlus, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
去除lucene繁琐的操作,让你专注于实现业务!
new LuceneX(new LuceneXConfig() {
@Override
public void configLuceneX(BaseConfig me) {
me.add("d:/","test",Empty.class);
}
});
import com.ld.lucenex.field.FieldKey;
import com.ld.lucenex.field.LDType;
public class Empty{
@FieldKey(type = LDType.IntPoint)
private int id;
@FieldKey(type = LDType.StringField)
private String name;
@FieldKey(type = LDType.TextField,highlight = true)
private String text;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}
List<Empty> empties = new ArrayList<>(10);
for (int i=0;i<10;i++){
Empty empty = new Empty();
empty.setId(i);
empty.setName("新闻");
empty.setText("8月29日,2019世界人工智能大会在上海开幕,本届大会以“智联世界,无限可能”为主题,展示包括中国在内各国最新的AI产品和技术。在本届大会上,除了各国展出的最新AI技术和产品外,由华为、寒武纪、依图等国内企业自主研发的人工智能芯片组成的AI芯片墙更是受到参观者的关注。图为微软带来了智能菜品识别系统,把食物放在收银检测区,便能自觉识别价格。更厉害的是,系统还能给出营养分析报告,例如热量、脂肪、碳水物、蛋白质等含量。");
empties.add(empty);
}
ServiceImpl<Empty> basisService = ServiceFactory.getService(ServiceImpl.class);
basisService.addObjects(empties);
ServiceImpl<Empty> basisService = ServiceFactory.getService(ServiceImpl.class);
Empty searchOne = basisService.searchOne(new TermQuery(new Term("name","百度一下")));
@FieldKey(type = LDType.TextField,highlight = true)
private String text;
import com.ld.lucenex.service.ServiceImpl;
public class DemoService<T> extends ServiceImpl<T> {
public DemoService(String sourceKey) {
super(sourceKey);
}
}
下载后使用Maven打包成jar
mvn clean package -DskipTests
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。