简体   繁体   中英

Is it possible to query on Solr Alias with different schema collections?

I am using SolrCloud, version 8.1.1 and I have an Alias under which there are several collections, but not all of them have the same xml schema. So I have collection "a" which has the field "is_a" and collection b which does not have this field. Is it possible to make a query that provides a check on the "is_a" field only for the documents in collection "a"? If I perform the query on the Alias, I get the error: Undefined field: is_a

The error is expected as the field name is not available in another collection.

In short you cannot perform the same query on alias until and unless you have common schema defined or you need to have the name common searchable fields in he schema which is applicable/available in all the collection.

Another alternative could be create a copy field which will hold the common searchable fields. And while using alias you can search on that copy field which is holding all the searchable field required for your application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM