Skip to content

Instantly share code, notes, and snippets.

@brikis98
Created March 1, 2012 20:02
Show Gist options
  • Select an option

  • Save brikis98/1952715 to your computer and use it in GitHub Desktop.

Select an option

Save brikis98/1952715 to your computer and use it in GitHub Desktop.
Cleo: the open source technology behind LinkedIn typeahead search
curl -v -X POST -H "Content-type: application/xml" -H "Accept: application/xml" http://localhost:8080/cleo-primer/rest/elements/_ -d '
<element>
<id>1063</id>
<name>Google Inc. (GOOG)</name>
<title>Technology - Computer Software: Programming Data Processing</title>
<url>http://www.nasdaq.com/symbol/goog</url>
<score>159350</score>
<term>google</term>
<term>inc.</term>
<term>goog</term>
</element>
'
curl -v -X POST -H "Content-type: application/xml" -H "Accept: application/xml" http://localhost:8080/cleo-primer/rest/elements -d '
<element-list>
<element>
<id>1063</id>
<name>Google Inc. (GOOG)</name>
<title>Technology - Computer Software: Programming Data Processing</title>
<url>http://www.nasdaq.com/symbol/goog</url>
<score>159350</score>
<term>google</term>
<term>inc.</term>
<term>goog</term>
</element>
<element>
<id>1253</id>
<name>Intel Corporation (INTC)</name>
<title>Technology - Semiconductors</title>
<url>http://www.nasdaq.com/symbol/intc</url>
<score>129668</score>
<term>intel</term>
<term>corporation</term>
<term>intc</term>
</element>
</element-list>
'
curl -v -X DELETE http://localhost:8080/cleo-primer/rest/elements/1063
curl -v -X GET -H "Accept: application/json" http://localhost:8080/cleo-primer/rest/elements
curl -v -X GET -H "Accept: application/xml" http://localhost:8080/cleo-primer/rest/elements
curl -v -X GET -H "Accept: application/json" http://localhost:8080/cleo-primer/rest/elements/1063
curl -v -X GET -H "Accept: application/xml" http://localhost:8080/cleo-primer/rest/elements/1063
curl -v -X GET -H "Accept: application/json" http://localhost:8080/cleo-primer/rest/elements/1..100
curl -v -X GET -H "Accept: application/xml" http://localhost:8080/cleo-primer/rest/elements/1..100
curl -v -X GET -H "Accept: application/json" http://localhost:8080/cleo-primer/rest/elements/search?query=goo
curl -v -X GET -H "Accept: application/xml" http://localhost:8080/cleo-primer/rest/elements/search?query=goo
curl -v -X PUT -H "Content-type: application/xml" -H "Accept: application/xml" http://localhost:8080/cleo-primer/rest/elements/1063 -d '
<element>
<id>1063</id>
<name>Google Inc. (GOOG)</name>
<title>Technology - Computer Software: Programming Data Processing</title>
<url>http://www.nasdaq.com/symbol/goog</url>
<score>159350</score>
<term>google</term>
<term>inc.</term>
<term>goog</term>
</element>
'
./scripts/post-element-list.sh dat/nasdaq-company-list.xml
./scripts/post-element.sh dat/nasdaq-google.xml dat/nasdaq-intel.xml
MAVEN_OPTS="-Xms1g -Xmx1g" mvn jetty:run \
-Dcleo.instance.name=Company \
-Dcleo.instance.type=cleo.primer.GenericTypeaheadInstance \
-Dcleo.instance.conf=src/main/resources/config/generic-typeahead
@brikis98
Copy link
Author

brikis98 commented Mar 2, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment