Here is how you can do that:
Query titleQuery, viewsQuery;
titleQuery.setBoost(0.8);
viewsQuery.setBoost(0.2);
BooleanQuery query = new BooleanQuery();
query.add(titleQuery, Occur.MUST); // or Occur.SHOULD if this clause is optional
query.add(viewsQuery, Occur.SHOULD); // or Occur.MUST if this clause is required
// use query to search documents
The score will be proportional to 0.8*score(titleQuery) + 0.2*score(viewsQuery)
(to a multiplicative constant).
To leverage your views
field, you will probably need to use a ValueSourceQuery.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…