Skip to content

Instantly share code, notes, and snippets.

@takezoe
Created May 26, 2012 11:47
Show Gist options
  • Save takezoe/2793666 to your computer and use it in GitHub Desktop.
Save takezoe/2793666 to your computer and use it in GitHub Desktop.
Case class support in solr-scala-client
case class Product(id: String, manu: String, name: String)
val client = new SolrClient("http://localhost:8983/solr")
val result = client.query("name: %name%")
.fields("id", "manu", "name")
.sortBy("id", Order.asc)
.getResultAs[Product](Map("name" -> "ThinkPad X201s"))
result.documents.foreach { product =>
println(product)
}
@takezoe
Copy link
Author

takezoe commented May 26, 2012

This is an exmaple of case class support in the solr-scala-client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment