Thanks Shawn, perhaps the comment on the luceneMatchVersion in the example schema.xml could be changed to reflect / clarify this?
<!-- Controls what version of Lucene various components of Solr adhere to. Generally, you want to use the latest version to get all bug fixes and improvements. It is highly recommended that you fully re-index after changing this setting as it can affect both how text is indexed and queried. --> this comment made me think that the parameter is affecting the index side of things too (aka index format version). I.e. I would appreciate seeing there things like you just mentioned regarding emulated behaviour. So we could draw a line between the index format (low-level, not controllable by a user) and analysis chain etc (solr config level, user controllable). I have tried specifying the postingsFormat on a per field type basis. For postingsFormat="Lucene40" I get: org.apache.solr.client.solrj.SolrServerException: java.lang.UnsupportedOperationException: this codec can only be used for reading at org.apache.solr.client.solrj.embedded.EmbeddedSolrServer.request(EmbeddedSolrServer.java:155) ... 12 more Caused by: java.lang.UnsupportedOperationException: this codec can only be used for reading at org.apache.lucene.codecs.lucene40.Lucene40PostingsFormat.fieldsConsumer(Lucene40PostingsFormat.java:246) at org.apache.lucene.codecs.perfield.PerFieldPostingsFormat$FieldsWriter.addField(PerFieldPostingsFormat.java:131) at org.apache.lucene.index.FreqProxTermsWriterPerField.flush(FreqProxTermsWriterPerField.java:336) at org.apache.lucene.index.FreqProxTermsWriter.flush(FreqProxTermsWriter.java:85) at org.apache.lucene.index.TermsHash.flush(TermsHash.java:116) at org.apache.lucene.index.DocInverter.flush(DocInverter.java:53) at org.apache.lucene.index.DocFieldProcessor.flush(DocFieldProcessor.java:81) at org.apache.lucene.index.DocumentsWriterPerThread.flush(DocumentsWriterPerThread.java:465) at org.apache.lucene.index.DocumentsWriter.doFlush(DocumentsWriter.java:506) at org.apache.lucene.index.DocumentsWriter.flushAllThreads(DocumentsWriter.java:616) at org.apache.lucene.index.IndexWriter.prepareCommitInternal(IndexWriter.java:2864) at org.apache.lucene.index.IndexWriter.commitInternal(IndexWriter.java:3022) at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:2989) at org.apache.solr.update.DirectUpdateHandler2.commit(DirectUpdateHandler2.java:578) at org.apache.solr.update.processor.RunUpdateProcessor.processCommit(RunUpdateProcessorFactory.java:95) at org.apache.solr.update.processor.UpdateRequestProcessor.processCommit(UpdateRequestProcessor.java:64) at org.apache.solr.update.processor.DistributedUpdateProcessor.doLocalCommit(DistributedUpdateProcessor.java:1457) at org.apache.solr.update.processor.DistributedUpdateProcessor.processCommit(DistributedUpdateProcessor.java:1434) at org.apache.solr.update.processor.LogUpdateProcessor.processCommit(LogUpdateProcessorFactory.java:157) at org.apache.solr.handler.RequestHandlerUtils.handleCommit(RequestHandlerUtils.java:69) at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:68) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1916) at org.apache.solr.client.solrj.embedded.EmbeddedSolrServer.request(EmbeddedSolrServer.java:150) ... 12 more But that is just a side note. I have added a comment to the cwiki regarding the possible values for postingsFormat parameter (currently values marked as n/a): https://cwiki.apache.org/confluence/display/solr/Field+Type+Definitions+and+Properties Dmitry On Fri, Apr 11, 2014 at 10:42 AM, Shawn Heisey <s...@elyograg.org> wrote: > On 4/11/2014 12:42 AM, Dmitry Kan wrote: > > Thanks! So solr 4.7 does not seem to respect the luceneMatchVersion on > the > > binary (index) level. Or perhaps, I misunderstand the meaning of the > > luceneMatchVersion. > > luceneMatchVersion does not dictate the index format. It is a way to > signal things like analysis components that they should emulate behavior > (sometimes buggy) found in an earlier version. Not all analysis > components will operate differently when this config is used. There is > probably not a central repository of how the version affects Solr/Lucene > behavior. > > > I wonder whether there is any possibility of defining the version of the > > codec in solr config/schema. > > I don't think Solr exposes any way to define an entire codec. You can > change things individually, like the postings format and docValues > format on a field, but there's no way (that I know of) to define an > entire codec. The overall index format is not something you can specify. > > I think it could be possible to come up with some XML syntax for > describing a complete codec and then write code to parse it and build > the codec ... but because my understanding of how all the Lucene pieces > fit together is relatively low, there may be some really good reason > that Solr doesn't offer this functionality. > > Thanks, > Shawn > > -- Dmitry Blog: http://dmitrykan.blogspot.com Twitter: http://twitter.com/dmitrykan