Skip to content

tinysou/tinysou-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tinysou-java

Tinysou Java client

Installation

Download tinysou-java-v1.00.jar and import to your java project as a library

Usage

 import com.tinysou.help.Collection;
 import com.tinysou.help.Engine;
 import com.tinysou.help.Document;

Engine

 Engine engine = new Engine(AUTH_TOKEN);
 

List:

 engine.list();

Create:

 engine.create(ENGINE_NEME, DISPLAY_NAME);

Get:

 engine.get(ENGINE_NEME);

Update:

 engine.update(ENGINE_NEME,DISPLAY_NAME);

Delete:

 engine.delete(ENGINE_NEME);

Collection

 Collection collection = new Collection(AUTH_TOKEN, ENGINE_NEME);

List:

 collection.list();

Create:

 collection.create(COLLECTION_NAME, field_types);

Get:

 collection.get(COLLECTION_NAME);

Delete:

 collection.delete(COLLECTION_NAME);

Document

 Document document = new Document(AUTH_TOKEN, ENGINE_NEME, COLLECTION_NAME);
 

List:

 document.list();

Create:

 document.create(field_types);

Get:

 document.get(documentId);

Update:

 document.update(documentId,field_types);

Delete:

 document.delete(documentId);

Search

 Search search = new Search(AUTH_TOKEN, ENGINE_NEME, "page");
 JSONObject paramsBody = new JSONObject();
	paramsBody.put("q", "搜索");
 search.setParams(paramsBody);
 search.doSearchSingleCollection();  //单collection搜索
 paramsBody.put("c", "page1,page2");
 search.doSearchMultiCollection();  //跨collection搜索

Autocomplete

  AutoComplete autoComplete = new AutoComplete(AUTH_TOKEN, ENGINE_NEME, "page");
  JSONObject paramsBody = new JSONObject();
  paramsBody.put("q", "搜索");
  autoComplete.setParams(paramsBody);
  autoComplete.doAutoCompleteSingleCollection();  //单collection自动补全
  paramsBody.put("c", "page1,page2");
  autoComplete.doAutoCompleteMultiCollection();  //跨collection自动补全

Examples

See examples

Contributing

  1. Fork it ( https://github.com/tinysou/tinysou-java/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

Tinysou Java client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages