lucene查询
程序员文章站
2022-07-09 09:30:24
...
多字段查询
MultiFieldQueryParser 就用这个类
待续。。。
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日期排序及组合查询
下一篇: lucene--创建index