# Delta index in Ultrasphinx

**URL:** <https://www.ruby-forum.com/t/delta-index-in-ultrasphinx/147510>\
**Category:** Rails\
**Created:** [September 2, 2008, 4:24pm UTC](https://www.ruby-forum.com/t/delta-index-in-ultrasphinx/147510 "2008-09-02T16:24:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anatoliy85](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c89c15/32.png) [@anatoliy85](https://www.ruby-forum.com/u/anatoliy85)\
**Post date:** [September 2, 2008, 4:24pm UTC](https://www.ruby-forum.com/t/delta-index-in-ultrasphinx/147510/1 "2008-09-02T16:24:47Z")

</div>

Hello, all

I have a problem with delta index in Ultrasphinx.

My configuration:

* * *

## app/models/user.rb:

class User \< ActiveRecord::Base  
belongs\_to :user\_profile

## is\_indexed :fields =\> [‘created\_at’, ‘e\_mail’], :delta =\> true end

## mysql\> show columns from users; ±--------------------------±-------------±-----±----±--------±---------------+ | Field | Type | Null | Key | Default | Extra | ±--------------------------±-------------±-----±----±--------±---------------+ | id | int(11) | NO | PRI | NULL | auto\_increment | | e\_mail | varchar(64) | YES | MUL | NULL | | | created\_at | datetime | YES | | NULL | | ±--------------------------±-------------±-----±----±--------±---------------+ rake ultrasphinx:configure

## (in /home/tolya/test\_sphinx) Rebuilding configurations for development environment Available models are User Generating SQL

## rake ultrasphinx:index

(in /home/tolya/test\_sphinx)  
$ indexer --config  
‘/home/tolya/test\_sphinx/config/ultrasphinx/development.conf’ --all  
Sphinx 0.9.8-release (r1371)  
Copyright © 2001-2008, Andrew Aksyonoff

## using config file ‘/home/tolya/test\_sphinx/config/ultrasphinx/development.conf’… indexing index ‘main’… collected 5093 docs, 0.1 MB sorted 0.0 Mhits, 100.0% done total 5093 docs, 127491 bytes total 0.077 sec, 1652958.05 bytes/sec, 66032.23 docs/sec indexing index ‘delta’… collected 0 docs, 0.0 MB total 0 docs, 0 bytes total 0.011 sec, 0.00 bytes/sec, 0.00 docs/sec

rake ultrasphinx:daemon:start  
(in /home/tolya/test\_sphinx)  
Sphinx 0.9.8-release (r1371)  
Copyright © 2001-2008, Andrew Aksyonoff

## using config file ‘/home/tolya/test\_sphinx/config/ultrasphinx/development.conf’… Started successfully

## mysql\> select id, e\_mail, created\_at from users where e\_mail LIKE ‘%romanzdswetest%’; ±-----±-------------------------±--------------------+ | id | e\_mail | created\_at | ±-----±-------------------------±--------------------+ | 3996 | removed\_email\_address@domain.invalid | 2007-10-22 18:34:31 | ±-----±-------------------------±--------------------+

## In console:

> > @s = Ultrasphinx::Search.new(:query =\> ‘romanzdswetest’).run  
> > @s.results  
> > =\> [#\<User id: 3996,…  
> > Ultrasphinx is find “romanzdswetest”.

* * *

## Now insert a data to table users:

## mysql\> insert into users (e\_mail, created\_at) values (“removed\_email\_address@domain.invalid”, NOW());

## mysql\> select id, e\_mail, created\_at from users where e\_mail LIKE ‘removed\_email\_address@domain.invalid%’; ±-----±------------------±--------------------+ | id | e\_mail | created\_at | ±-----±------------------±--------------------+ | 6223 | removed\_email\_address@domain.invalid | 2008-09-02 17:08:39 | ±-----±------------------±--------------------+ 1 row in set (0.00 sec)

## rake ultrasphinx:index:delta

(in /home/tolya/test\_sphinx)  
$ indexer --config  
‘/home/tolya/test\_sphinx/config/ultrasphinx/development.conf’ --rotate  
delta  
Sphinx 0.9.8-release (r1371)  
Copyright © 2001-2008, Andrew Aksyonoff

## using config file ‘/home/tolya/test\_sphinx/config/ultrasphinx/development.conf’… indexing index ‘delta’… collected 0 docs, 0.0 MB total 0 docs, 0 bytes total 0.023 sec, 0.00 bytes/sec, 0.00 docs/sec rotating indices: succesfully sent SIGHUP to searchd (pid=3224). Index rotated ok

## but in console:

## ./script/console

Loading development environment (Rails 2.1.0)

> > @s = Ultrasphinx::Search.new(:query =\> ‘zzzxxxccc’).run  
> > @s.results  
> > =\> []

* * *

Where is i make mistake? Why Ultrasphinx doesn’t find “zzzxxxccc”?

In the attachment is locate my development.conf.

Help me please to solve my problem.

Thanks

---

<div class="post-metadata">

**Author:** ![anatoliy85](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c89c15/32.png) [@anatoliy85](https://www.ruby-forum.com/u/anatoliy85)\
**Post date:** [September 2, 2008, 4:29pm UTC](https://www.ruby-forum.com/t/delta-index-in-ultrasphinx/147510/2 "2008-09-02T16:29:35Z")

</div>

On 2 Sep 2008, at 15:24, Anatoliy Vv wrote:

> using config file  
> ‘/home/tolya/test\_sphinx/config/ultrasphinx/development.conf’…  
> indexing index ‘delta’…  
> collected 0 docs, 0.0 MB  
> total 0 docs, 0 bytes  
> total 0.023 sec, 0.00 bytes/sec, 0.00 docs/sec  
> rotating indices: succesfully sent SIGHUP to searchd (pid=3224).  
> Index rotated ok

You can tell thinks have gone wrong at this stage: the index should  
have picked up at least 1 document

> * * *
> 
> Where is i make mistake? Why Ultrasphinx doesn’t find “zzzxxxccc”?
> 
> In the attachment is locate my development.conf.

Sphinx is using the updated\_at column to decide which rows should be  
in the delta index. However you haven’t set updated\_at

Fred

---

<div class="post-metadata">

**Author:** ![anatoliy85](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c89c15/32.png) [@anatoliy85](https://www.ruby-forum.com/u/anatoliy85)\
**Post date:** [September 2, 2008, 5:23pm UTC](https://www.ruby-forum.com/t/delta-index-in-ultrasphinx/147510/3 "2008-09-02T17:23:25Z")

</div>

thank you very much!
