# Sphinx search not indexing the new record

**URL:** <https://www.ruby-forum.com/t/sphinx-search-not-indexing-the-new-record/191555>\
**Category:** Rails\
**Created:** [July 14, 2010, 2:01pm UTC](https://www.ruby-forum.com/t/sphinx-search-not-indexing-the-new-record/191555 "2010-07-14T14:01:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gandhi-tush](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/5daacb/32.png) [@gandhi-tush](https://www.ruby-forum.com/u/gandhi-tush)\
**Post date:** [July 14, 2010, 2:01pm UTC](https://www.ruby-forum.com/t/sphinx-search-not-indexing-the-new-record/191555/1 "2010-07-14T14:01:23Z")

</div>

Hi,  
I have an application which is doing search using “sphnix” search.  
Everything is working fine but whenever user adding new record it is not  
able to index. For that I have to again reindex the all records.

My user model is like this  
class User \< ActiveRecord::Base  
define\_index do  
indexes first\_name  
indexes last\_name  
indexes email  
end  
end

Can anyone tell me how to solve this?

Thanks,  
Tushar

---

<div class="post-metadata">

**Author:** ![gandhi-tush](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/5daacb/32.png) [@gandhi-tush](https://www.ruby-forum.com/u/gandhi-tush)\
**Post date:** [July 14, 2010, 7:24pm UTC](https://www.ruby-forum.com/t/sphinx-search-not-indexing-the-new-record/191555/2 "2010-07-14T19:24:16Z")

</div>

> indexes email  
> end  
> end
> 
> Can anyone tell me how to solve this?

This is normal. Not sure which of the sphinx plugins you are using, but  
look into the “delta” options. You’ll have to add a flag to the model  
and configure it. Basically it creates your normal index and then a  
“delta” index (anything new/updated). Sphinx will then search both.  
It’s still advisable to re-index periodically so as not to have too big  
a delta.

-philip
