<commit_before># eson-couch_potato

Integration of Eson into couch_potato.

## Usage

Indexing by hand:

```ruby
class Post
  include CouchPotato::Persistence
  include Eson::Searchable

  property :title
end

p = Post.new(:title => 'foobar')
CouchPotato.database.index_document(p)
CouchPotato.database.search { query { match_all { } } }
```

Indexing as an after-save hook:

```ruby
class Post
  include CouchPotato::Persistence
  include Eson::Searchable

  property :title
end

p = Post.new(:title => 'foobar')
CouchPotato.database.index_document(p)
CouchPotato.database.search { query { match_all { } } }
```

```ruby
class WithAfterHook
  include CouchPotato::Persistence
  include Eson::Searchable
  
  after_save :index
  
  property :title
end

w = WithAfterHook.new(:title => 'foobar')
CouchPotato.database.save_document(s)
```<commit_msg>Remove meaningless example<commit_after># eson-couch_potato

Integration of Eson into couch_potato.

## Usage

Indexing by hand:

```ruby
class Post
  include CouchPotato::Persistence
  include Eson::Searchable

  property :title
end

p = Post.new(:title => 'foobar')
CouchPotato.database.index_document(p)
CouchPotato.database.search { query { match_all { } } }
```

Indexing as an after-save hook:

```ruby
class WithAfterHook
  include CouchPotato::Persistence
  include Eson::Searchable
  
  after_save :index
  
  property :title
end

w = WithAfterHook.new(:title => 'foobar')
CouchPotato.database.save_document(s)
```
{'fraction_non_alphanumeric': 0.1142080217539089, 'fraction_numerical': 0.0, 'mean_word_length': 5.0081632653061225, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '35929', 'n_tokens_mistral': 543, 'n_tokens_neox': 503, 'n_words': 117}