Skip to content

Instantly share code, notes, and snippets.

@dscape
Created April 21, 2010 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dscape/374289 to your computer and use it in GitHub Desktop.
Save dscape/374289 to your computer and use it in GitHub Desktop.
Using Redis with MarkLogic Server
cd ~/Desktop
wget http://redis.googlecode.com/files/redis-1.2.6.tar.gz
tar -xvf redis-1.2.6.tar.gz
cd redis-1.2.6/
make
./redis-server
## you need port 6379 open. Possible to change.
## for non-debian distro use whatever applies (e.g. yum)
sudo apt-get install ruby irb rdoc rubygems git-core
sudo gem install rack redis mongrel
git clone git://github.com/dscape/Sikwamic.git
cd Sikwamic
ruby sikwamic.rb
## You need port 9291 open. for an alternative change sikwamic.rb
## primitive support, redis offers some more functionality
## check http://code.google.com/p/redis/wiki/IntroductionToRedisDataTypes
(:
: You need to have cq running (this also means marklogic server installed)
: Just:
: - install MarkLogic Server
: - access localhost:8001
: - add a new app server
: - set name as cq
: - set root as Samples/cq
: - set port to an available port (e.g. 8003)
: - click ok
: - you can now access cq in http://localhost:8003
:)
xdmp:http-get("http://localhost:9291/foo")[2]//text()
(: returns empty sequence :)
xdmp:http-post("http://localhost:9291/foo/bar")[2]//text()
xdmp:http-get("http://localhost:9291/foo")[2]//text()
(: returns bar :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment