Skip to content

Commit

Permalink
escape group name
Browse files Browse the repository at this point in the history
  • Loading branch information
thammegowda committed Aug 23, 2016
1 parent b332217 commit 5070e36
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ import edu.usc.irds.sparkler.model.{Resource, SparklerJob}
import edu.usc.irds.sparkler.solr.SolrGroupPartition
import edu.usc.irds.sparkler.util.SolrResultIterator
import org.apache.solr.client.solrj.SolrQuery
import org.apache.solr.client.solrj.util.ClientUtils
import org.apache.spark.rdd.RDD
import org.apache.spark.{Partition, SparkContext, TaskContext}
import ClientUtils.escapeQueryChars

import scala.collection.JavaConversions._

Expand All @@ -47,7 +49,7 @@ class CrawlDbRDD(sc: SparkContext,
val partition: SolrGroupPartition = split.asInstanceOf[SolrGroupPartition]
val batchSize = 100
val query = new SolrQuery(generateQry)
query.addFilterQuery(s"${Resource.GROUP}:${partition.group}")
query.addFilterQuery(s"""${Resource.GROUP}:"${escapeQueryChars(partition.group)}"""")
query.addFilterQuery(s"${Resource.JOBID}:${job.id}")
query.set("sort", sortBy)
query.setRows(batchSize)
Expand Down

0 comments on commit 5070e36

Please sign in to comment.