-
-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boost responses by country code #1650
base: master
Are you sure you want to change the base?
Conversation
I've just added the support of I thik this is good to go now 😄 |
Can I have feedback on this PR ? Is the API OK for you ? |
Hi @Joxit, sorry I'm super busy this week (Berlin Buzzwords) and next week I'm off to Kosovo (FOSS4G). I'll try and have a look over it while I'm away next week. FYI I think the test issue with the Eszett is caused by tyxla/remove-accents#12 |
Okay, thanks for your response 😄 |
Heya, I just got back from Kosovo and super exhausted, just wanted to send you a quick note that this is on my todo list. |
765f0d9
to
82e5655
Compare
Hi Peter, thank you for your update! I've sync the branch with master according to #1655 Rest well 😉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry this took so long to review 🙇
Code looks great, nice and clean and easy to read 👍
One minor question about the ES query.
I'm happy to merge this.
Can we please add user-facing documentation for this API.
query/view/focus_multi_match.js
Outdated
return { | ||
'function_score': { | ||
'query': peliasQuery.view.leaf.multi_match(view_name)(vs), | ||
'score_mode': 'multiply', | ||
}, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question about this...
what's the purpose of wrapping the 'leaf' query in a 'function_score' here?
doesn't the 'function_score' query require an Array named 'functions', with at least one function?
the 'score_mode' property then effects how scoring is applied to the multiple 'functions'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess what I'm asking is, what's the difference between this and:
return peliasQuery.view.leaf.multi_match(view_name)(vs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried different score_mode
and wanted to be consistent with other functions, but you're right, since I'm using the defaults value, it's semantically the same, so I can return the leaf instead of the function_score
👍
These API params are available for I noticed that there are no new tests in |
82e5655
to
cb0f26b
Compare
Hi Pete, thank you for your comments. I removed the For the Currently, the result for
If we add a |
👋 I did some awesome work for the Pelias project and would love for everyone to have a look at it and provide feedback.
Here's the reason for this change 🚀
closes pelias/pelias#944
Here's what actually got changed 👏
I added the query paramater
focus.country
andfocus.gid
available only with autocomplete API. This will apply a defined boost set to 1.5 and not customizable. I did some tests and seems to be correct. I also tried 1.25 and 2Here's how others can test the changes 👀
Some examples with
focus.country
Some examples with
focus.gid
I had to change a test in
test/unit/helper/diffPlaces.js
, IDK why 🤷