I'm trying to figure out what the best way is to make the similarity class aware of the schema. One straightforward way to do this would be to have it implement SolrCoreAware, even though this is currently disallowed by the list of 'aware compatible' classes in SolrResourceLoader.
Are there going to be any obvious problems with this? The only one I can think of would be if the IndexSchema and therefore the Similarity are shared across multiple cores. Karsten Mike Klaas wrote: > > On 3-Mar-08, at 4:59 PM, Karsten Sperling wrote: > >> Is there any work going on or planned on a Similarity sub-class that >> allows the lenghtNorm() behaviour to be changed via schema.xml on a >> field-by-field basis? >> >> At the moment I'm really only after omitting length norms for certain >> fields, but using a custom similarity that checks for hard coded field >> names seems like a rather inflexible kludge. >> >> Ideally the lengthNorm() call would be delegated to the FieldType >> instance of the field in question where a specific behaviour could be >> plugged in by specifying the class to use (similar to analyzer and >> tokenizer). >> >> Any comments on what others have done in this direction would be >> appreciated. > > I'm using this "kludge". I only have 3-4 distinct field type classes, > so it doesn't feel too bad. > > -Mike
