Question

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');
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top