openfisca / legislation-explorer

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

Search multiple words #102

Closed sandcha closed 7 years ago

sandcha commented 7 years ago

Connected to #84

Manage multiple words search. First words have more importance than next ones. Multiple matching in name has priority. And it looks for matching in name and in description but doesn't look for word repetition in name and in description.

fpagnoux commented 7 years ago

If I type salaire base, I get results I should not have:

image

fpagnoux commented 7 years ago

Sorry I had to rewrite some of the code , but the demo is coming 😱 .

As I can't review what is not here anymore, some feedback:

In general, it's more readable to avoid working with the indexes, unless you really have to (and you rarely have).

Otherwise, storing the scores as properties was really clever, and the sorting was well done 👍 .

fpagnoux commented 7 years ago

I'm not able to review this, as I edited the code. @MattiSG do you have time ? Other @sandcha or @Anna-Livia ?

sandcha commented 7 years ago

@fpagnoux Ok with your code changes as well.

fpagnoux commented 7 years ago

Ok, rebasing and merging 🚀