Skip to content

Instantly share code, notes, and snippets.

@rotty3000
Created July 31, 2013 15:57
Show Gist options
  • Save rotty3000/6123310 to your computer and use it in GitHub Desktop.
Save rotty3000/6123310 to your computer and use it in GitHub Desktop.
use a StringQuery to set boost
Query stringQuery = StringQueryFactoryUtil.create("field:term^4");
BooleanClause clause = BooleanClauseFactoryUtil.create(searchContext, stringQuery, BooleanClauseOccur.SHOULD.toString());
searchContext.setBooleanClauses(new BooleanClause[] {clause});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment