Latest 0.0.6
Homepage https://github.com/1amageek/Tong
License MIT
Platforms ios 10.0, requires ARC
Dependencies APIKit, ElastiQ
Authors

Tong is library for using ElasticSearch with Swift.

Tong depends on ElastiQ.

Installation

CocoaPods

  • Insert pod 'Tong' to your Podfile.
  • Run pod install.

Note: CocoaPods 1.3.1 is required to install Tong.

Usage

Configure in AppDelegate

Tong.Configure.setup(url: "URL", user: "user", password: "password", isEncrypted: false)

Make Object conforming to Searchable

class Post: Object, Searchable {
    static var _index: String {
        return "v1"
    }

    static var _type: String {
        return "post"
    }

    // Anything
}

Search

let query: ElastiQ = ElastiQ().term("_createdAt", 1503396721450)
Post.search(query: query) { (result) in
    switch result {
    case .success(let response): print(response)
    case .failure(let error): print(error)
    }
}

Reference

  • Salada Firebase model framework.
  • Tong Tong is library for using ElasticSearch with Swift.
  • dressing Dressing provides the functionality of CloudFunctions to connect Firebase and ElasticSearch.

Latest podspec

{
    "name": "Tong",
    "version": "0.0.6",
    "summary": "Tong works with Salada to speed up the development of iOS applications.",
    "description": "Tong is library for using ElasticSearch with Swift.nTypeSafe can handle Type to retrieve.",
    "homepage": "https://github.com/1amageek/Tong",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "1amageek": "[email protected]"
    },
    "social_media_url": "http://twitter.com/1amageek",
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/1amageek/Tong.git",
        "tag": "0.0.6"
    },
    "source_files": "Tong/**/*.swift",
    "requires_arc": true,
    "dependencies": {
        "APIKit": [],
        "ElastiQ": []
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This