: assuming I've written the subclass of the postings format, I need to tell
: Solr to use it.
: 
: Do I just do something like:
: 
: <fieldType name="ocr" class="solr.TextField" postingsFormat="MySubclass" />

the postingFormat xml tag in schema.xml just refers to the "name" of the 
postingFormat in SPI -- which is discussed in the PostingFormat 
javadocs...

https://lucene.apache.org/core/4_10_0/core/org/apache/lucene/codecs/PostingsFormat.html

...the nuts & bolts of it is that the PostingFormat baseclass should take 
care of all the SPI "name" registration that you need based on what you 
pass to the super() construction ... allthough now that i think about it, 
i'm not sure how you'd go about specifying your own name for the 
PostingFormat when also doing something like subclassing 
Lucene41PostingsFormat ... there's no Lucene41PostingsFormat constructor 
you can call from your subclass to override the name.

not sure what the expectation is there in the java API.


: Is there a way to set this for all fieldtypes or would that require writing
: a custom CodecFactory?

SchemaCodecFactory uses the Lucene default for any fieldType that doesn't 
define it's own postingFormat -- so if you wnated to change the 
postingFormat or *every* fieldType, then yes: you'd need to override the 
CodecFactory itself.



-Hoss
http://www.lucidworks.com/

Reply via email to