user2862834 user2862834 - 1 month ago 6
Linux Question

In Solr Cloud, is QueryElevationComponent mandatory in distributed collection?

I have collection that is distributed over multiple solr cloud node. To disable uniqueKey in schema, I also disable QueryElevationComponent in solrconfig.xml.

<!--
<searchComponent name="elevator" class="solr.QueryElevationComponent" >
<str name="queryFieldType">string</str>
<str name="config-file">elevate.xml</str>
</searchComponent>
-->


Configuration works fine in undistributed collection (1 shard, 1 rf). But if number of shards*rf are greater than 1, problem occures. When I execute query to distributed collection, than solr throws below exception.


java.lang.NullPointerException
at org.apache.solr.handler.component.QueryComponent.createMainQuery(QueryComponent.java:852)
at org.apache.solr.handler.component.QueryComponent.regularDistributedProcess(QueryComponent.java:721)
at org.apache.solr.handler.component.QueryComponent.distributedProcess(QueryComponent.java:674)
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:345)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:154)


Solr does not complain against indexing. Only querying is problem.

Answer

uniqueKey is required. as it will likely make routing in SolrCloud and document replacement in general fail.

Enable your uniqueKey in schema, if you are using solr in cloud mode.