Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

instant_answer: use focus when a region is specified #212

Merged
merged 1 commit into from
Mar 19, 2021
Merged

Conversation

remi-dupre
Copy link
Contributor

@remi-dupre remi-dupre commented Mar 18, 2021

Use a region code in the params to trigger use of the focus in instant answers.

For example when looking for "Ikea la vallette" from france:

# We get results from Germany by default
$ curl "http://localhost:5000/v1/instant_answer?q=ikea%20la%20valette&lang=fr" | grep "Am Wandersmann 2-4 (Hofheim am Taunus)" | wc -l
1
# We get results from France with the region set
$ curl "http://localhost:5000/v1/instant_answer?q=ikea%20la%20valette&lang=fr&user_region=fr" | grep "zac Valgora, 83160 LA VALETTE DU VAR" | wc -l
1

This still requires:

  • stabilization of the parameter name
  • a few tests, there is actually two distinct mechanisms using the focus (for intentions and no intentions)

I used the region database from erdapfel and removed fields that are not likely to be used. I kept bbox as it may be useful in the future if we want to tweak the zoom level depending on the region size (a purely naive approach would not fit, for example France's bbox covers most of the world).

@remi-dupre remi-dupre changed the title instant_answer: use focus when a region is specified in headers instant_answer: use focus when a region is specified Mar 18, 2021
@remi-dupre remi-dupre force-pushed the ia-focus branch 2 times, most recently from eee07f0 to 4b84690 Compare March 19, 2021 06:25
@remi-dupre remi-dupre marked this pull request as ready for review March 19, 2021 06:25
@remi-dupre
Copy link
Contributor Author

@amatissart I've just rebased and pushed

@remi-dupre remi-dupre merged commit 0fb52d2 into master Mar 19, 2021
@remi-dupre remi-dupre deleted the ia-focus branch March 19, 2021 11:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants