欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

lucene查询

程序员文章站 2022-07-09 09:30:24
...
多字段查询
MultiFieldQueryParser 就用这个类

String[] fields = new String[]{"evaluation", "workExperiences", "training"};
BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD, BooleanClause.Occur.SHOULD, BooleanClause.Occur.SHOULD};
//多字段查询
Query query = MultiFieldQueryParser.parse(keywords, fields, flags, new PaodingAnalyzer());

FullTextQuery hibQuery = s.createFullTextQuery( query, Resume.class ).setMaxResults(50);



StandardAnalyzer analyzer = new StandardAnalyzer();
MultiFieldQueryParser q = new MultiFieldQueryParser(new String[] {"title","tag" }, analyzer);


待续。。。
相关标签: lucene Java