git.iko.soy/typeable/bloodhound
on master help sign in
bump Cabal, document getDocument
commit8ef19681cc98695ac7a8e9286711d52e7b39851f authorChris Allen <cma@bitemyapp.com> dateThu 11 Dec 2014, 20:44 (12 years ago) parent652852c
2 files changed+15−11
.travis.yml+10−10 src/Database/Bloodhound/Client.hs+5−1
.travis.yml+10−10
@@ -22,7 +22,7 @@ env:
2222before_install:
2323 - sudo add-apt-repository -y ppa:hvr/ghc
2424 - sudo apt-get update
25− - sudo apt-get install cabal-install-1.18 ghc-$GHCVER
25+ - sudo apt-get install cabal-install-1.20 ghc-$GHCVER
2626 - sudo apt-get install happy-1.19.3
2727 - export PATH=/opt/ghc/$GHCVER/bin:/opt/happy/1.19.3/bin:$PATH
2828 - wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$ESVER.deb
@@ -30,31 +30,31 @@ before_install:
3030 - sudo service elasticsearch start
3131
3232install:
33− - cabal-1.18 update
34− - cabal-1.18 install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls
33+ - cabal-1.20 update
34+ - cabal-1.20 install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls
3535
3636# Here starts the actual work to be performed for the package under
3737# test; any command which exits with a non-zero exit code causes the
3838# build to fail.
3939script:
4040 # -v2 provides useful information for debugging
41− - cabal-1.18 configure --enable-tests --enable-benchmarks -v2
41+ - cabal-1.20 configure --enable-tests --enable-benchmarks -v2
4242
4343 # this builds all libraries and executables
4444 # (including tests/benchmarks)
45− - cabal-1.18 build
45+ - cabal-1.20 build
4646
47− - cabal-1.18 test
48− - cabal-1.18 check
47+ - cabal-1.20 test
48+ - cabal-1.20 check
4949
5050 # tests that a source-distribution can be generated
51− - cabal-1.18 sdist
51+ - cabal-1.20 sdist
5252
5353 # check that the generated source-distribution can be built & installed
54− - export SRC_TGZ=$(cabal-1.18 info . | awk '{print $2 ".tar.gz";exit}') ;
54+ - export SRC_TGZ=$(cabal-1.20 info . | awk '{print $2 ".tar.gz";exit}') ;
5555 cd dist/;
5656 if [ -f "$SRC_TGZ" ]; then
57− cabal-1.18 install "$SRC_TGZ";
57+ cabal-1.20 install "$SRC_TGZ";
5858 else
5959 echo "expected '$SRC_TGZ' not found";
6060 exit 1;
src/Database/Bloodhound/Client.hs+5−1
@@ -350,7 +350,11 @@ encodeBulkOperation (BulkUpdate (IndexName indexName)
350350 doc = object ["doc" .= value]
351351 blob = encode metadata `mappend` "\n" `mappend` encode doc
352352
353−
353+-- | 'getDocument' is a straight-forward way to fetch a single document from
354+-- Elasticsearch using a 'Server', 'IndexName', 'MappingName', and a 'DocId'.
355+-- The 'DocId' is the primary key for your Elasticsearch document.
356+--
357+-- >>> yourDoc <- getDocument testServer testIndex testMapping (DocId "1")
354358getDocument :: Server -> IndexName -> MappingName
355359 -> DocId -> IO Reply
356360getDocument (Server server) (IndexName indexName)