spark-solr icon indicating copy to clipboard operation
spark-solr copied to clipboard

Ability to use collection aliases

Open uyilmaz opened this issue 4 years ago • 0 comments

Afaik SolrJ supports querying a solr collection using an alias in place of real collection names, but in spark-solr, when an alias is provided in place of a collection it fails with "collection x not found" error.

I couldn't find another config parameter to provide an alias.

val solrOptions = Map(
      "zkHost" -> "myZkHost",
      "collection" -> "myAlias",
      "query" -> "*:*",
      "flatten_multivalued"-> "false"
    )

val data = spark.read.format("solr").options(solrOptions).load

data.createOrReplaceTempView("myView")
data.count()

fails with the above error.

uyilmaz avatar Jun 17 '20 08:06 uyilmaz