No. Not possible.
To update a field, need to delete the whole record and re-insert it.
The REPLACE INTO
command, just does this in one step.
题
Is it possible to update only one field out of two in sphinx sql or in PHP? for example the below is the index that I have
+-----------+---------+
| Field | Type |
+-----------+---------+
| id | integer |
| article | field |
| notes | field |
| post_date | uint |
| gid | uint |
+-----------+---------+
and then I'm inserting this
insert into artidx values (1, 'test article', 'note one', 1234,1);
Then this, which is updating "article" just fine but removing "notes",
replace into artidx (id, article) values (1, 'test article modified');
解决方案
No. Not possible.
To update a field, need to delete the whole record and re-insert it.
The REPLACE INTO
command, just does this in one step.