lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: per-field similarity
Date Wed, 25 Jun 2008 21:06:28 GMT

: > i assume you mean "Searcher.getSimilarity(String fieldName, Query q)" to
: > replace the current Searcher.getSimilarity() right?
: 
: No, I meant Similarity (it's more like a factory method on the
: Similarity class).
: The Searcher.getSimilarity() could remain unchanged.
: A Similarity is what is passed into the IndexWriter, and you would
: want the same per-field flexibility there.

Hmmm... that seems like it would be confusing: particularly since in the 
IndexWriter case the "Query" param would never make sense.  changing 
IndexWriter.getSimilarity to take a "String fieldName" and changing 
Searcher.getSimilarity to take "String fieldName, Query q" seem like they 
would be more straight forward.

(There's also the potential ambiguity of "how many times do i call 
Similarity.getSimilarity() before i stop?" ... it may seem silly, but if 
you're working in a Query or Scorer or Weight you may not be sure if it's 
been done yet)



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message