Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add support for multiple solr cores #31

Merged
merged 1 commit into from

2 participants

@holdenk

No description provided.

@adamalix adamalix merged commit a194773 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 4, 2012
  1. @holdenk
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 2 deletions.
  1. +1 −1  build.sbt
  2. +12 −1 src/main/scala/com/foursquare/slashem/Schema.scala
View
2  build.sbt
@@ -1,6 +1,6 @@
name := "slashem"
-version := "0.9.12"
+version := "0.9.13"
organization := "com.foursquare"
View
13 src/main/scala/com/foursquare/slashem/Schema.scala
@@ -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)
Something went wrong with that request. Please try again.