Hello!

The _version_ field is needed by some of Solr 4.0 functionality like
transaction log or partial documents update. If you want to use them,
just update your schema.xml and put the _version_ field definition
there.

However if you don't want those, you can remove the transaction log
configuration in your solrconfig.xml. However please remember that
when using SolrCloud you'll need that field. 

-- 
Regards,
 Rafał Kuć
 Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch - ElasticSearch

> On a stock Solr 4 install, I can run the server fine if I don't change
> any config files. When I replace the example
> solr/collection1/conf/schema.xml I get the following error:
> collection1:
> org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
> Unable to use updateLog: _version_field must exist in schema, using
> indexed="true" stored="true" and multiValued="false" (_version_ does
> not exist)

> Here is the replacement schema:
> <?xml version="1.0" encoding="UTF-8"?>
> <schema name="discoapiRecent" version="0.3">
>         <types>
>                 <fieldType name="string" class="solr.StrField"
omitNorms="true"/>>
>         </types>
>         <fields>
>                 <field name="id" type="string" stored="true"
> multiValued="false" indexed="true" required="true"/>
>                 <field name="text" type="string" stored="true"
> multiValued="false" indexed="true"/>
>         </fields>
>         <defaultSearchField>text</defaultSearchField>
>         <solrQueryParser defaultOperator="AND"/>
>         <uniqueKey>id</uniqueKey>
> </schema>


> I see that the original schema.xml had a _version_ field, but how does
> Solr know that? I did remove the original index thinking that maybe
> the extant documents were crying for the _version_ field, but removing
> that index did not help. Grepping for _version_ doesn't show it
> existing anywhere else in the collection1 index:

> ~/apache-solr-4.0.0/example$ grep -ir "_version_" *
> multicore/core1/conf/schema.xml:  <field name="_version_" type="long"
>     indexed="true"  stored="true"/>
> multicore/core0/conf/schema.xml:  <field name="_version_" type="long"
>    indexed="true"  stored="true"/>
> solr/collection1/conf/schema.xml.ORIGINAL:      trailing underscores
> (e.g. _version_) are reserved.
> solr/collection1/conf/schema.xml.ORIGINAL:   <field name="_version_"
> type="long" indexed="true" stored="true"/>

> Where might the problem lie? And other than the index and schema.xml
> (and possibly solrconfig.xml) what else should I purge to get a
> "clean" index?

> Thanks.

Reply via email to