Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 80 lines (53 sloc) 3.227 kb
2f555f2 @holdenk Add README & License (apache-2.0)
holdenk authored
1 # Slashem (SolrRogue)
2
3 Slashem (SolrRogue) is a type-safe internal Scala DSL for constructing and
4 executing find requests against SOLR. It is a rogue-like for solr. It is not
5 currently full expressive to SOLR's query functionality, but covers the main
6 use cases that we encountered.
7
6f498e8 @holdenk I am not a vampire (Vuilding -> Building)
holdenk authored
8 ## Building and Installation
2f555f2 @holdenk Add README & License (apache-2.0)
holdenk authored
9
10 Use sbt (simple-build-tool) to build:
11
12 $ sbt clean update package
13
14 The finished jar will be in 'target/'.
15
4bce4ba @holdenk Update README with some more examples and mention hooks in code for exte...
holdenk authored
16 ## Hooks to overload certain features
17
18 Slashem provides two main hooks for extension. Most people will probably
19 wish to overload the default logging mechanism which throws away everything.
20 To do this simply implement the SolrQueryLogger trait and set the logger param
21 on your Schema objects to your custom logger.
22
23 The other hook is only useful if you are using Solr for geospatail information,
24 we provide a trait called SolrGeoHash which has two required functions, namely
25 coverString and rectCoverString. Most people will not need to implement this.
26
e47800c @holdenk Bump version & update some documentation
holdenk authored
27 ### Multiple Solr cores & non-stanrd query paths
28
29 Support for multiple cores is done by overriding "core" in the model (wich is an Option[String]).
30 If you have a non-standard query path you can override queryPath in your model.
31
2f555f2 @holdenk Add README & License (apache-2.0)
holdenk authored
32 ## Examples
4bce4ba @holdenk Update README with some more examples and mention hooks in code for exte...
holdenk authored
33
d670bb7 @holdenk linkify some links in the README
holdenk authored
34 [QueryTest.scala](https://github.com/foursquare/slashem/blob/master/src/test/scala/com/foursquare/slashem/QueryTest.scala) contains sample queries and shows the corresponding query.
35 [SolrRogueTest.scala](https://github.com/foursquare/slashem/blob/master/src/test/scala/com/foursquare/slashem/SolrRogueTest.scala) countains some sample records.
2f555f2 @holdenk Add README & License (apache-2.0)
holdenk authored
36
4bce4ba @holdenk Update README with some more examples and mention hooks in code for exte...
holdenk authored
37 A basic query against the SUserTest might look something like
38
39 val q = SUserTest where (_.fullname eqs "jon")
40
061f074 @epishkin Fixed several typos
epishkin authored
41 This would do a phrase search for "jon" against the fullname field in SUserTest.
4bce4ba @holdenk Update README with some more examples and mention hooks in code for exte...
holdenk authored
42 A more complex query might specify a different query parser like so:
43
44 val q = SUserTest where (_.fullname eqs "holden") useQueryType("edismax")
45
46 Frequently with edismax queries you want to run your query against multiple fields
47 and or boost queries which match the entire phrase. The followingis an example of how
48 to do this:
49
50 val q = SVenueTest where (_.default contains lols) useQueryType("edismax") phraseBoost(_.text, 1) phraseBoost(_.name,200) phraseBoost(_.aliases,25) queryField(_.text) queryField(_.ngram_name, 0.2) queryField(_.tags, 0.01) tieBreaker(0.2)
51
52
2f555f2 @holdenk Add README & License (apache-2.0)
holdenk authored
53 ## Dependencies
54
46e2572 @holdenk Add some comments, slight code cleanup.
holdenk authored
55 lift, joda-time, junit, finagle, jackson. These dependencies are managed by
e47800c @holdenk Bump version & update some documentation
holdenk authored
56 the build system. Note: some of the transitive dependencies may fail to resolve
57 from the central maven. If you are using sbt you can fix this by adding
46e2572 @holdenk Add some comments, slight code cleanup.
holdenk authored
58
e47800c @holdenk Bump version & update some documentation
holdenk authored
59 ivyXML := (
60 <dependencies>
61 <exclude module="jmxtools"/>
62 <exclude module="jmxri"/>
63 </dependencies>
64 )
46e2572 @holdenk Add some comments, slight code cleanup.
holdenk authored
65
e47800c @holdenk Bump version & update some documentation
holdenk authored
66 ## Warnings still a very early version. There are likely bugs (sorry!). Let us know
46e2572 @holdenk Add some comments, slight code cleanup.
holdenk authored
67 if you find any. While we can't promise timely fixes, it will help :)
2f555f2 @holdenk Add README & License (apache-2.0)
holdenk authored
68
69 ## Maintainers
70
71 Slashem (SolrRogue) was initial developed by Foursquare Labs for internal use.
cd9e11d @micrypt Edited README.md via GitHub
micrypt authored
72 The majority of our solr related calls at Foursquare go through this library.
2f555f2 @holdenk Add README & License (apache-2.0)
holdenk authored
73 The current maintainers are:
74
75 - Jon Shea jonshea@foursquare.com
76 - Govind Kabra govind@foursquare.com
77 - Holden Karau holden@foursquare.com
97c4a87 @adamalix Added .gitignore and new maintainers.
adamalix authored
78 - Adam Alix aalix@foursquare.com
2f555f2 @holdenk Add README & License (apache-2.0)
holdenk authored
79
80 Contributions welcome!
Something went wrong with that request. Please try again.