: "how do i set the score of each document result to be the score of that : of the field that best matches the search terms"?
you'll want something like this psuedo code... DisjunctionMaxQuery dq = new DMQ foreach fieldname in list_of_fields { BooleanQuery bq = new BQ foreach word in list_of_words { bq.add(new TermQuery(fieldname,word), SHOULD) } bq.setMinSHouldMatch(1) } dq.setTieBreaker(0.0) ...the DisjunctioNmaxQuery will only take it's score from whichever of hte BooleanQueries scores highest, and the setMinSHouldMatch will ensure that those boolean queries will match as long as at least one of the words is found in that field, but the more words that match the higher the score. then all you need to do is modify your similarity class to change the tf() function so that a doc doesn't get a really high score just for matching one word many many times. -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org