On Tue, 2006-05-23 at 14:29 -0700, Marvin Humphrey wrote: > Greets, > > Is it possible to have an IndexWriter apply different Similarity > models to different Fields?
You only want to apply this to the norms? Are up for an ad-hoc solution? Refactor : class DocumentWriter { private final void writeNorms(String segment) throws IOException { for(int n = 0; n < fieldInfos.size(); n++){ FieldInfo fi = fieldInfos.fieldInfo(n); if(fi.isIndexed && !fi.omitNorms){ float norm = fieldBoosts[n] * similarity.lengthNorm(fi.name, to this: float norm = fieldBoosts[n] * fi.similarity.lengthNorm(fi.name, You'll have to hack the similarity in FieldInfos.add(Document) and Field or Document. If I was to add more than one Field with the same name in a Document I'd probably hack it in the Document. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]