Created
May 26, 2012 11:47
-
-
Save takezoe/2793666 to your computer and use it in GitHub Desktop.
Case class support in solr-scala-client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is an exmaple of case class support in the solr-scala-client.