openfisca / legislation-explorer

Explore legislation formulas and parameters.
https://legislation.demo.openfisca.org
GNU Affero General Public License v3.0
26 stars 13 forks source link

Searching for "nbJ" doesn't find "nbJ" even though the variable exists #210

Open Morendil opened 5 years ago

Morendil commented 5 years ago

Searching for "nbJ" only brings up the parameter TP_nbj in impot_revenu.credits_impot.ppe.

However, searching for "Nombre d'enfants majeurs célibataires sans enfant" brings up two results, nbJ and nombre_enfants_majeurs_celibataires_sans_enfant, respectively defined on entities FoyerFiscal and Menage.

Given that a variable named X exists, I would expect that searching for the exact text X will bring up variable X, for all values of X.

I hit this while debugging one of the generated tax tests, I was trying to understand the input variables and entered nbJ in search to see what it was, and quite taken aback when it didn't show up - I started assuming that the branch of France I was on had defined new variables compared to master and wasted a bit of time falsifying that assumption.

I have little idea what's special about nbJ. It doesn't seem to have to do with the case of the J. I don't see how it could have to do with the length of the search string, given that you can search for "cf" and have cf come up.

The only hypothesis I can come up with is that it's because nbJ and nombre_enfants_majeurs_celibataires_sans_enfant have the exact same description "Nombre d'enfants majeurs célibataires sans enfant", and this somehow messes up indexing. I can test this sometime next week, unless someone wants to look into it first.