/**
 * 搜索域加权
 */
Map<String, Float> boosts = new HashMap<>();
boosts.put("title", 1.2f);
boosts.put("author", 1.1f);
boosts.put("content", 1.0f);
/**
 * 多条件之间的关系
 */
BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD,
BooleanClause.Occur.SHOULD,
BooleanClause.Occur.SHOULD};
Query query=MultiFieldQueryParser.parse(key, new String[]{"title","author","content"},flags, analyzer);

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2022-12-23
  • 2021-06-23
  • 2021-09-14
  • 2021-12-19
猜你喜欢
  • 2022-12-23
  • 2021-06-19
  • 2021-05-26
  • 2022-03-11
  • 2021-12-09
  • 2021-08-25
相关资源
相似解决方案