Permalink
Browse files

Merge pull request #31 from holdenk/master

Add support for multiple solr cores
  • Loading branch information...
2 parents 5a90079 + b8b4708 commit a194773de9d09cebc4580b565548bba51cdf7d96 @adamalix adamalix committed May 7, 2012
Showing with 13 additions and 2 deletions.
  1. +1 −1 build.sbt
  2. +12 −1 src/main/scala/com/foursquare/slashem/Schema.scala
View
@@ -1,6 +1,6 @@
name := "slashem"
-version := "0.9.12"
+version := "0.9.13"
organization := "com.foursquare"
@@ -264,6 +264,17 @@ trait SolrMeta[T <: Record[T]] extends SlashemMeta[T] {
* It can just be one element if you wish */
def servers: List[String]
+ /* Not using the primary core, set it here*/
+ def core: Option[String] = None
+
+ /* Need a more crazy query path? override */
+ def queryPath: String = {
+ core match {
+ case None => "/solr/select/"
+ case Some(x) => "/solr/%s/select".format(x)
+ }
+ }
+
// The name is used to determine which props to use as well as for logging
def solrName: String
@@ -355,7 +366,7 @@ trait SolrMeta[T <: Record[T]] extends SlashemMeta[T] {
}
def queryString(params: Seq[(String, String)]): QueryStringEncoder = {
- val qse = new QueryStringEncoder("/solr/select/")
+ val qse = new QueryStringEncoder(queryPath)
qse.addParam("wt", "json")
params.foreach( x => {
qse.addParam(x._1, x._2)

0 comments on commit a194773

Please sign in to comment.