Quickstart
This quickstart requires a Cleo distribution of version 1.2.0 or above.
The src/examples directory contains a number of classes such as
GenericCompanyTypeahead and MyFriendsTypeahead.
These example classes demonstrate how to develop and configure applications to perform
generic or network typeahead search.
Code Examples
- CompanyTypeahead
- MyFriendsTypeahead
This example shows how to configure Cleo to perform typeahead search over companies in absence of social network. It provides a reference implementation for generic typeahead search over relatively large data sets. It can be adapted to support varying domains such as companies, groups, magazines and so on.
This example shows how to configure Cleo to perform typeahead search over the social network of friends.
Restful WebApp
The cleo-primer package provides a basic RESTful implementation of partial, out-of-order and real-time typeahead and autocomplete services.
You can follow the steps below to set up a typeahead service for public companies listed at Nasdaq.
- Download cleo-primer from Github.
- Launch the cleo-primer web application from the cleo-primer folder.
- The
cleo.instance.nameis assignedCompanybecause we are building a typeahead service for companies listed at Nasdaq. - The
cleo.instance.typespecifies a Java classcleo.primer.GenericTypeaheadInstancethat instantiates an instance of Generic Typeahead. This is the only instance type supported by cleo-primer at the present time. We will add more in the coming future. - The
cleo.instance.confspecifies a file directory where several generic typeahead configuration files are located. For more information on configuring Generic Typeahead and Network Typeahead, please refer to the code examples listed above. - Index Nasdaq public companies using the prepared XML file.
- Visit the URL below to try out cleo-primer.
git clone --depth 1 https://github.com/jingwei/cleo-primer.git cleo-primer
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
You can customize the web application by choosing different values for cleo.instance.name, cleo.instance.type, and cleo.instance.conf. Depending on the size of your data sets, you may need to specify a different JVM heap size.
./scripts/post-element-list.sh dat/nasdaq-company-list.xml
If you have a different type of elements such as schools and publications, you need to prepare your XML file according to cleo.primer.rest.model.ElementDTO
http://localhost:8080/cleo-primer