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

Handle multiple words research #84

Closed fpagnoux closed 7 years ago

fpagnoux commented 7 years ago

As a legislation explorer user typing "salaire base" in the search field, I get the variable "salaire_de_base" in my results

MattiSG commented 7 years ago

Should supersede #55 if parameters are properly named.

MattiSG commented 7 years ago
  1. Select only variables where name contains each query words in either variable name or description.
  2. Group variables according to query word match count in variable name and order them in decreasing order.
  3. Group each subset according to query word match index sum and sort them in increasing order.
  4. Sort each sub-sub-subset according to alphabetical order.
  5. Concatenate all sub-sub-subsets and present them as ordered results list.

Examples

salaire base

crds

sandcha commented 7 years ago

1 => Every result must cover all query words ; remove results that doesn't.

Besides, query word repetition in a variable/parameter name and description has no influence ; do not change the order/weight of such results.