Browse files

Update README with some more examples and mention hooks in code for e…

  • Loading branch information...
1 parent 6f498e8 commit 4bce4bab8d751d9ca922a6839a904ef239bb2451 @holdenk holdenk committed Aug 15, 2011
Showing with 28 additions and 0 deletions.
  1. +28 −0
@@ -13,10 +13,38 @@ Use sbt (simple-build-tool) to build:
The finished jar will be in 'target/'.
+## Hooks to overload certain features
+Slashem provides two main hooks for extension. Most people will probably
+wish to overload the default logging mechanism which throws away everything.
+To do this simply implement the SolrQueryLogger trait and set the logger param
+on your Schema objects to your custom logger.
+The other hook is only useful if you are using Solr for geospatail information,
+we provide a trait called SolrGeoHash which has two required functions, namely
+coverString and rectCoverString. Most people will not need to implement this.
## Examples
[QueryTest.scala] contains sample queries and shows the corresponding query.
[SolrRogueTest.scala] countains some sample records.
+A basic query against the SUserTest might look something like
+ val q = SUserTest where (_.fullname eqs "jon")
+This would do a pharse search fro "jon" against the fullname field in SUserTest.
+A more complex query might specify a different query parser like so:
+ val q = SUserTest where (_.fullname eqs "holden") useQueryType("edismax")
+Frequently with edismax queries you want to run your query against multiple fields
+and or boost queries which match the entire phrase. The followingis an example of how
+to do this:
+ val q = SVenueTest where (_.default contains lols) useQueryType("edismax") phraseBoost(_.text, 1) phraseBoost(,200) phraseBoost(_.aliases,25) queryField(_.text) queryField(_.ngram_name, 0.2) queryField(_.tags, 0.01) tieBreaker(0.2)
## Dependencies
lift, joda-time, junit, finagle, jackson. These dependencies are managed by

0 comments on commit 4bce4ba

Please sign in to comment.