Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
eddloschi committed Mar 14, 2014
1 parent 71e83b4 commit 9fa6078
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ development:
index:
path: "/tmp/sphinx"
source:
xmlpipe_command: "rails r '<%= index.klass %>.sphinx_indexes[:<%= index.name %>].generate_xmlpipe2(STDOUT)'"
xmlpipe_command: "rails r '<%= index.klass %>.sphinx_indexes[:<%= index.name %>].xmlpipe2(STDOUT)'"
```

### Setting up indexes on models
Expand Down Expand Up @@ -138,6 +138,18 @@ class Person
end
```

##### Manipulating Dynamic Indexes

If your objects changed and this changes must be reflected on your dynamic indexes, call `Mongoid::Giza::regenerate_sphinx_indexes` to clear the existing ones and regenerate all again.

If you need finer control, you may use `Mongoid::Giza#generate_sphinx_indexes` to generate all dynamic indexes for the object (which will replace any existing one with the same name), and `Mongoid::Giza::remove_generated_sphinx_indexes` with the name of the generated indexes which you want to remove.

##### Difference Between Dynamic Index and Generated Index

A dynamic index is just the skeleton that creates indexes from every object of the class.

A generated index is the actual index that was dynamically created based on the object which the dynamic index used for evaluation.

### Indexing

There are 3 ways to populate the Sphinx index: use the model class' `sphinx_indexer!` method, `Mongoid::Giza::Indexer.instance.index!` or `Mongoid::Giza::Indexer.instance.full_index!`
Expand Down

0 comments on commit 9fa6078

Please sign in to comment.