Kaibin
Kaibin

Reputation: 474

Solr 4.0.0 define <uniqueKey> id</uniqueKey> as a "long" type throws an error on startup

In my entity clas, I defined id:

@Field("id")
protected Long id;

then in solr4.0.0 schema.xml, i define:

<field name="id" type="long" indexed="true" stored="true" />
<uniqueKey>id</uniqueKey>

then solr throws exception on startup. If 'id' is defined as 'string' type, no exception. so my question is: what's the solution if i insisted on defining 'id' as long type.

Upvotes: 1

Views: 950

Answers (2)

Kaibin
Kaibin

Reputation: 474

Just remove the below node in solrconfig.xml file:

<searchComponent name="elevator" class="solr.QueryElevationComponent" >  
<!-- pick a fieldType to analyze queries -->  
<str name="queryFieldType">string</str>  
<str name="config-file">elevate.xml</str>  
</searchComponent> 

Upvotes: 1

Jayendra
Jayendra

Reputation: 52799

Check SOLR-2997
It seems QueryElevationComponent needs the Unique key in String format. So if you don't need it you can remove it.

Upvotes: 3

Related Questions