I’m using Sphinx (v. 0.99) in my Java application.
I also use it with the thinking_sphinx plugin on a rails app.
For the Java app I am trying to use delta indexes – I’m mostly figuring it out from the existing rails config and app behaviour.
I have a boolean field called ‘delta’ on the model object that I search.
Whenever I update or create a record I set that delta field to true.
I’ve confirmed that the delta and main index queries in my sphinx config pick up the correct records based on that delta field.
Also, my code triggers a delta re-index whenever updating or inserting (I never delete data).
After updating a record it correctly appears in the delta index but of course a stale version is still in the main index.
I can see this by running the ‘search’ command manually.
So far, this all works the same as for my rails app – the rails app would also show a stale copy in the main index too if I check with the search command.
However, if I search via my rails app I no longer see that stale record (even though the command-line search shows it’s still there).
However, if I search via my Java app I still see that stale record in my results.
I’m guessing somehow the thinking_sphinx plugin is dealing with this in some way or I’ve got some configuration entry wrong somewhere.
I’ve been through the thinking_sphinx source to see if it’s handling this in some special way but I didn’t see anything obvious.
Ideally I want the same behaviour in my Java app.
My (Java) sphinx config is here.
I’m not an expert in thinking_sphinx or Java, but if you want a duplicated document to disappear from the main part of the index you can use Sphinx kill-list (http://sphinxsearch.com/docs/current.html#conf-sql-query-killlist). This was invented exactly for cases like yours.
Hope it will help.