Under certain conditions, creatures (such as your dwarves) will vomit. This may occur from an injury to an organ (usually the stomach, pancreas, and such), or from cave adaptation. Vomit does not seem to create an unhappy thought ("nauseated by the sun" is from cave adaptation).
After vomiting once, a creature will begin to retch, bringing up nothing. The retching will continue in place of vomiting until the creature eats again.
Dwarves that have been stationed for too long without food or water will occasionally eat vomit. This causes an unhappy thought. Verify
[MATERIAL:VOMIT] - reconstructed from data extracted from memory [STATE_COLOR:ALL:DARK_GREEN] [STATE_NAME_ADJ:ALL_SOLID:vomit] [STATE_NAME_ADJ:SOLID_PRESSED:pressed vomit] [BASIC_COLOR:2:0] [BUILD_COLOR:2:0:0] [TILE_COLOR:7:7:1] [SPEC_HEAT:4181] [HEATDAM_POINT:10180] [SOLID_DENSITY:1200]