Ulcers are the classic cause of typical indigestion. These are breaks in the lining of the stomach (gastric ulcer) or duodenum (duodenal ulcer) that hurt due to exposure to gastric acids. Most ulcers are caused by an infection called Helicobacter pylori (HP), and can be cured by appropriate antibiotic treatment. Some ulcers and smaller "erosions" result from reactions to medicines, especially those taken for muscle pains and arthritis (aspirin compounds and non-steroidal anti-inflammatory drugs [NSAIDs]).
The symptoms of ulcers are characteristically intermittent; symptoms occur for a few weeks, and may disappear for a few months (even if the ulcer is still present). Fortunately, stomach cancer has become less common nowadays; it should be suspected if dyspepsia is more continuous, and associated with loss of appetite or weight. The pain of a duodenal ulcer can be worse when the stomach is empty (for example in the middle of the night), and is then often relieved by food.
The vast majority of people with indigestion do not have ulcers or erosions (and cancer is very rare). Investigation often shows only a disturbance of stomach movements – so called "nonulcer dyspepsia."
Appropriate tests for dyspepsia include checking on the H. pylori infection, and looking for inflammation of the stomach and duodenal lining (ulcers and gastritis). This can be done with a barium meal (upper GI X-ray series); the patient swallows a cup of thick white barium liquid in front of an X-ray screen. The radiologist can see it travel through the esophagus, stomach, and duodenum, noting any holdup or irregularity. Nowadays, doctors often prefer to do a more direct examination using an endoscope. Upper endoscopy examinations are performed under light sedation. The endoscope is passed through the mouth and the lining of the esophagus, stomach and duodenum are seen up close and in color on a television monitor. Photographs can be taken, and specimens retrieved for laboratory analysis.