Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Id field as long type

Tags:

solr

lucene

I'm trying to use Id field as Long and getting this error:

ERROR: Error CREATEing SolrCore 'brands': Unable to create core 
[brands] Caused by: uniqueKey field (id) can not be configured to use a 
Points based FieldType: plong

Here is my schema.xml:

<?xml version="1.0" encoding="UTF-8"?>
<schema name="brands-config" version="1.6">
<uniqueKey>id</uniqueKey>
<fieldType name="plong" class="solr.LongPointField" docValues="true"/>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true"/>
<field name="name" type="string"/>
<field name="id" type="plong" multiValued="false" indexed="true" required="true" stored="true"/>
</schema>

My solrconfig.xml is basic one - only removed the part mentioned in this thread but it didn't help.

Is there any way to make my id field type long? I need it this way to avoid too much mapping.

like image 283
ohwelppp Avatar asked Nov 08 '22 11:11

ohwelppp


1 Answers

As described here you can't use a point based field as uniqueKey. Instead, you could use the string type.

like image 143
Denis E. Sanches Avatar answered Nov 15 '22 09:11

Denis E. Sanches