aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid 'arrdem' McKenzie <reid@factual.com>2015-08-12 18:28:36 -0700
committerReid 'arrdem' McKenzie <reid@factual.com>2015-08-12 18:28:36 -0700
commit1280ae4869a3dea425257aa7a96836449687fb57 (patch)
treebf33dfd734ce99c0bab2f3d7fa62ff6e08f6f266
parent381b5d0a5669c29103bfd21c60561e20c8b8a1a2 (diff)
downloadclucy-1280ae4869a3dea425257aa7a96836449687fb57.tar.gz
clucy-1280ae4869a3dea425257aa7a96836449687fb57.tar.xz
clucy-1280ae4869a3dea425257aa7a96836449687fb57.zip
Add support for :all as a count value
Because sometimes you just want to get everything
-rw-r--r--src/clucy/core.clj4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/clucy/core.clj b/src/clucy/core.clj
index 68c43c1..227b7d1 100644
--- a/src/clucy/core.clj
+++ b/src/clucy/core.clj
@@ -209,7 +209,9 @@ fragments."
:or
,,QueryParser/OR_OPERATOR)))
query (.parse parser query)
- hits (.search searcher query (int max-results))
+ hits (if (= max-results :all)
+ (.search searcher query)
+ (.search searcher query (int max-results)))
highlighter (make-highlighter query searcher highlight)
start (* page results-per-page)
end (min (+ start results-per-page)