The gas-phase metallicity and ionization parameter are two primary parameters that drive the variations of emission line spectra in HII regions. There is an increasing amount of evidence that these two parameters are correlated. Theoretical works on the dynamical evolution of HII regions predict an anti-correlation between metallicity and ionization parameter. However, observations of HII region spectra have yielded a variety of different correlations, including anti-correlations, positive correlations, and even no correlation. All these measurements of the correlation rely on photoionization modeling. Also, different combinations of emission lines are used for calibrating metallicity and ionization parameter in different works. To solve the above problem, we examine how the derived correlation between metallicity and ionization parameter depends on the choice of models and emission lines. In this talk, I will show that it is important to constrain the model parameters using observational data before making any measurement. With the MaNGA IFU data, we compute a best-fit photoionization model for general HII regions and use a Bayesian method to fit metallicities and ionization parameters simultaneously. Our result shows that a positive correlation exists between the gas-phase metallicity and ionization parameter, regardless of which combination of emission lines is used for the fitting. This result clearly contradicts the prediction by the dynamical model. I will discuss potential mechanisms that lead to this discrepancy, and how it might be solved with future IFU surveys on HII regions.