Wage indexation practices have changed. Evidence on the U.S. for instance suggests that wages were heavily indexed to past inflation during the Great Inflation but not during the Great Moderation. However, most DSGE models assume fixed indexation parameters in wage setting, which might not be structural in the sense of Lucas (1976). This paper presents a New-Keynesian model in which workers, by maximizing their welfare, set their wage indexation rule in response to aggregate shocks and monetary policy. We find that workers index their wages to past inflation when technology and permanent inflation-target shocks drive output fluctuations; when aggregate demand shocks do, workers index to trend-inflation. In addition, workers' choices do not coincide with the social planner's choice, which may explain the observed changes in wage indexation in the post-WWII U.S. data.