<commit_before># Redis-Search

High performance real-time search (Support Chinese), index in Redis for Rails application

## Features

* Real-time search
* High performance
* Segment words search and prefix match search
* Support ActiveRecord and Mongoid
* Sort results by one field
* Homophone search, pinyin search

## Requirements

* Redis 2.2+

## Install

in Rails application Gemfile

  gem 'redis','>= 2.1.1'
  gem 'chinese_pinyin', '0.3.0'
  gem 'rmmseg-cpp-huacnlee', '0.2.8'
  gem 'redis-search', '0.6'

install bundlers

    $ bundle install

## Configure

create file in: config/initializers/redis_search.rb

    require "redis-search"
    redis = Redis.new(:host => "127.0.0.1",:port => "6379")
    # change redis database to 3, you need use a special database for search feature.
    redis.select(3)
    Redis::Search.configure do |config|
      config.redis = redis<commit_msg>Update README.<commit_after># Redis-Search

High performance real-time search (Support Chinese), index in Redis for Rails application

## Features

* Real-time search
* High performance
* Segment words search and prefix match search
* Support ActiveRecord and Mongoid
* Sort results by one field
* Homophone search, pinyin search

## Requirements

* Redis 2.2+

## Install

in Rails application Gemfile

    gem 'redis','>= 2.1.1'
    gem 'chinese_pinyin', '0.3.0'
    gem 'rmmseg-cpp-huacnlee', '0.2.9'
    gem 'redis-search', '0.6.2'

install bundlers

    $ bundle install

## Configure

create file in: config/initializers/redis_search.rb

    require "redis-search"
    redis = Redis.new(:host => "127.0.0.1",:port => "6379")
    # change redis database to 3, you need use a special database for search feature.
    redis.select(3)
    Redis::Search.configure do |config|
      config.redis = redis
{'fraction_non_alphanumeric': 0.11142061281337047, 'fraction_numerical': 0.02841225626740947, 'mean_word_length': 3.6528497409326426, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6046842', 'n_tokens_mistral': 621, 'n_tokens_neox': 592, 'n_words': 188}