Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Add support for multiple solr cores #31

Merged
merged 1 commit into from almost 2 years ago

2 participants

Holden Karau Adam Alix
Holden Karau
holdenk commented May 04, 2012

No description provided.

Adam Alix adamalix merged commit a194773 into from May 07, 2012
Adam Alix adamalix closed this May 07, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

May 04, 2012
Holden Karau Add support for multiple cores (fix foursquare#29) b8b4708
This page is out of date. Refresh to see the latest.
2  build.sbt
... ...
@@ -1,6 +1,6 @@
1 1
 name := "slashem"
2 2
 
3  
-version := "0.9.12"
  3
+version := "0.9.13"
4 4
 
5 5
 organization := "com.foursquare"
6 6
 
13  src/main/scala/com/foursquare/slashem/Schema.scala
@@ -264,6 +264,17 @@ trait SolrMeta[T <: Record[T]] extends SlashemMeta[T] {
264 264
    * It can just be one element if you wish */
265 265
   def servers: List[String]
266 266
 
  267
+  /* Not using the primary core, set it here*/
  268
+  def core: Option[String] = None
  269
+
  270
+  /* Need a more crazy query path? override */
  271
+  def queryPath: String = {
  272
+    core match {
  273
+      case None => "/solr/select/"
  274
+      case Some(x) => "/solr/%s/select".format(x)
  275
+    }
  276
+  }
  277
+
267 278
   // The name is used to determine which props to use as well as for logging
268 279
   def solrName: String
269 280
 
@@ -355,7 +366,7 @@ trait SolrMeta[T <: Record[T]] extends SlashemMeta[T] {
355 366
   }
356 367
 
357 368
   def queryString(params: Seq[(String, String)]): QueryStringEncoder = {
358  
-    val qse = new QueryStringEncoder("/solr/select/")
  369
+    val qse = new QueryStringEncoder(queryPath)
359 370
     qse.addParam("wt", "json")
360 371
     params.foreach( x => {
361 372
       qse.addParam(x._1, x._2)
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.