All Projects → arunkumar9t2 → Rxsuggestions

arunkumar9t2 / Rxsuggestions

Licence: apache-2.0
⌨️ RxJava library to fetch suggestions for keywords using Google Suggest API

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Rxsuggestions

Swiftype Search Jquery
Elastic Site Search jQuery search plugin
Stars: ✭ 74 (-20.43%)
Mutual labels:  search
Yana
Powerful note-taking app with nested documents, full-text search, rich-text editor, code snippet editor and more
Stars: ✭ 87 (-6.45%)
Mutual labels:  search
Npmarket
🛒 More efficient search for node packages.
Stars: ✭ 91 (-2.15%)
Mutual labels:  search
Lieu
community search engine
Stars: ✭ 76 (-18.28%)
Mutual labels:  search
C
Collection of various algorithms in mathematics, machine learning, computer science, physics, etc implemented in C for educational purposes.
Stars: ✭ 11,897 (+12692.47%)
Mutual labels:  search
Vim Rfc
📓 Query RFC database and download RFCs from within Vim.
Stars: ✭ 88 (-5.38%)
Mutual labels:  search
Search Index
A persistent, network resilient, full text search library for the browser and Node.js
Stars: ✭ 1,183 (+1172.04%)
Mutual labels:  search
Algoliasearch Client Android
Algolia Search API Client for Android
Stars: ✭ 92 (-1.08%)
Mutual labels:  search
Autocomplete
🔮 Fast and full-featured autocomplete library
Stars: ✭ 1,268 (+1263.44%)
Mutual labels:  search
Applied Ml
📚 Papers & tech blogs by companies sharing their work on data science & machine learning in production.
Stars: ✭ 17,824 (+19065.59%)
Mutual labels:  search
Search And Replace
A simple search for find strings in your WordPress database and replace the string.
Stars: ✭ 76 (-18.28%)
Mutual labels:  search
Metasearch
Search aggregator for Slack, Google Docs, GitHub, and more 🔍
Stars: ✭ 81 (-12.9%)
Mutual labels:  search
Search Ui
Search UI. Libraries for the fast development of modern, engaging search experiences.
Stars: ✭ 1,294 (+1291.4%)
Mutual labels:  search
Laravel Lucene Search
Laravel 4.2, 5.* package for full-text search over Eloquent models based on ZF2 Lucene.
Stars: ✭ 75 (-19.35%)
Mutual labels:  search
Searchwp Live Ajax Search
[WordPress Plugin] Enhance your search forms with live search (utilizes SearchWP if installed)
Stars: ✭ 91 (-2.15%)
Mutual labels:  search
Searx
Privacy-respecting metasearch engine
Stars: ✭ 10,074 (+10732.26%)
Mutual labels:  search
Gatsby Plugin Elasticlunr Search
Gatsby search plugin via elastic lunr client-side search index.
Stars: ✭ 88 (-5.38%)
Mutual labels:  search
Txtai.js
AI-powered search engine for JavaScript
Stars: ✭ 93 (+0%)
Mutual labels:  search
Monster
The Art of Template MetaProgramming (TMP) in Modern C++♦️
Stars: ✭ 90 (-3.23%)
Mutual labels:  search
Stayfit
📱 🏃 🍎 Fitness application that’s used to keep track of your physical fitness data, daily calorie count, invite friends to work out together and ultimately get healthy.
Stars: ✭ 90 (-3.23%)
Mutual labels:  search

API Download

Notice

Version 2 supporting RxJava 2 is in development in master branch. For version 1 with RxJava 1 support, visit v 1.0 branch

RxSuggestions

A RxJava library to fetch search suggestions backed by Google Suggest.

If you have a content based app, this library makes it easier to show search suggestions so that your users spend less time typing the whole word.

The implementation is decoupled meaning the suggestions fetching can be used for any purpose and not only limited to search.

Demo

RxSuggestionsDemo

Download

Library is available via jcenter().

  • Add jcenter() to your project level build.gradle file.
allprojects {
    repositories {
        jcenter()
    }
}
  • Add library dependency to module level build.gradle file.
dependencies{
    compile 'in.arunkumarsampath:suggestions:1.0.3'
}

Project Setup

This library is compiled with Java 8 and thus requires your project to have Java 8 compilation enabled. This was done since the old Jack compiler is deprecated in favor of improved Java 8 compiler starting from Android Studio 3.0+ and to take advantage of lamdas and try with resources.

If you are not using Android Studio 3.0+, follow this guide. Else if you already are, then add these lines to force compilation with Java 8.

android {
  // Configure only for each module that uses Java 8
  // language features (either in its source code or
  // through dependencies).
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
}

Usage

This library provides two different ways to fetch suggestions.

  • Using RxSuggestion#fetch(String). Example: Fetch suggestions for the word Batman:

    RxSuggestions.fetch("Batman")
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(suggestions -> {
                    // List of suggestions here.
                });
    
  • This library provides a convenient Transformer which takes a stream of strings and converts them in their suggestions. This is very helpful if you use library such as RxBinding with EditText.

    RxTextView.afterTextChangeEvents(searchBox)
                .map(changeEvent -> changeEvent.editable().toString())
                .compose(RxSuggestions.suggestionsTransformer())
                .doOnNext(this::setSuggestions) // Your suggestions
                .doOnError(t -> Log.e(TAG, t.toString()))
                .subscribe()
    

    Input transforming to reduce network requests is also handled by library itself so you don't have to use debounce etc.

Motivation

This feature was initially developed for use in my browser app Chromer.

Contributions

If you are a developer and would like to improve this library, please consider making a pull request or create an issue so I can look into it.

  • Code style is Android Studio default.
  • No hungarian notation.

License

Copyright 2017 Arunkumar

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].