Tôi đang cố gắng để có được một lõi Solr chạy với riêng của tôi schema.xml
, nhưng Solr (phiên bản 5.2.1) tiếp tục phàn nàn về thiếu các phần tử fieldType
thậm chí không trong các định nghĩa fields
của tôi.Lỗi Solr tạo lõi: fieldType [x] không tìm thấy trong lược đồ
org.apache.solr.common.SolrException: fieldType 'booleans' not found in the schema
Bất cứ khi nào tôi thêm một 'mất tích' fieldtype
lỗi khác bật lên phàn nàn về một fieldType
mất tích, như longs
vv, cho đến khi tôi đã thêm tất cả chúng và giản đồ được chấp nhận mà không có lỗi.
Bây giờ, làm thế nào để tôi phải cung cấp các phần tử fieldtype
này khi không có sử dụng cho chúng?
Trong config.xml
tôi có:
<schemaFactory class="ClassicIndexSchemaFactory"/>
Dưới đây là tôi schema.xml
:
<schema name="collections" version="1.5">
<fields>
<field name="id_object" type="string" indexed="true" stored="true" />
<field name="id_organization" type="string" indexed="true" stored="true" />
<field name="title" type="string" indexed="true" stored="true" />
<field name="artist" type="string" indexed="true" stored="true" />
<field name="searchname" type="string" indexed="true" stored="true" />
<field name="technique_group" type="string" indexed="true" stored="true" />
<field name="technique" type="string" indexed="true" stored="true" />
<field name="color_type" type="string" indexed="true" stored="true" />
<field name="color" type="string" indexed="true" stored="true" />
<field name="subject" type="string" indexed="true" stored="true" />
<field name="height" type="tint" indexed="true" stored="true" />
<field name="width" type="tint" indexed="true" stored="true" />
<field name="depth" type="tint" indexed="true" stored="true" />
<field name="price_sale" type="tfloat" indexed="true" stored="true" />
<field name="price_rental" type="tfloat" indexed="true" stored="true" />
<field name="price_rental_with_savings" type="tfloat" indexed="true" stored="true" />
<field name="savings_portion" type="tfloat" indexed="true" stored="true" />
<field name="year" type="tint" indexed="true" stored="true" />
<field name="is_for_rent" type="boolean" indexed="true" stored="true" />
<field name="is_for_sale" type="boolean" indexed="true" stored="true" />
<field name="status" type="string" indexed="true" stored="true" />
<field name="shipment" type="tfloat" indexed="true" stored="true" />
<field name="timestamp" type="tdate" indexed="true" stored="true" default="NOW" />
<!-- catch all field, must be multiValued if any of its source fields is -->
<field name="quick_search" type="text" indexed="true" stored="false" />
<!-- mandatory -->
<field name="_version_" type="tlong" indexed="true" stored="true" />
</fields>
<uniqueKey>id_object</uniqueKey>
<copyField source="id_object" dest="quick_search" />
<copyField source="title" dest="quick_search" />
<copyField source="artist" dest="quick_search" />
<copyField source="searchname" dest="quick_search" />
<copyField source="technique_group" dest="quick_search" />
<copyField source="technique" dest="quick_search" />
<copyField source="color_type" dest="quick_search" />
<copyField source="color" dest="quick_search" />
<copyField source="subject" dest="quick_search" />
<types>
<fieldtype name="string" class="solr.StrField" />
<fieldtype name="boolean" class="solr.BoolField" />
<fieldtype name="tint" class="solr.TrieIntField" />
<fieldtype name="tlong" class="solr.TrieLongField" />
<fieldtype name="tfloat" class="solr.TrieFloatField" />
<fieldtype name="tdate" class="solr.TrieDateField" />
<fieldtype name="text" class="solr.TextField"/>
</types>
</schema>
Không có một multiValued
trường duy nhất trong đó. Tuy nhiên, tôi đã cố gắng đặt rõ ràng multiValued='false'
cho từng trường riêng lẻ, nhưng không có kết quả. Ngay cả khi tôi bỏ toàn bộ lược đồ xuống chỉ còn một số trường String
thì nó vẫn tạo ra lỗi đó.
Tôi khá tự tin mình schema.xml
là OK nhưng có lẽ một số thiết lập ở đâu đó nên nói với Solr để mang nó dễ dàng.
Điều đó trông giống như một giải pháp thanh lịch hơn nhiều so với việc chỉ bình luận toàn bộ điều đó. Để làm việc này, tôi đã phải sử dụng ** ManagedIndexSchemaFactory ** thay vì ** ClassicIndexSchemaFactory **, đặt 'mutable = true' và sử dụng một tên khác với schema.xml – acdhirr
trong' Solr 6.3.0' nó cũng hoạt động. Phần cần thiết có thể được tìm thấy trong 'solrconfig.xml'. Nhân tiện, tôi cũng cần xóa 's' khỏi' tdates', 'tlongs' và' tdoubles'. Tôi đã lấy 'solrconfig.xml' từ' basic_configs'. – TitanFighter