Browse Source

feat(focus.point): use exponential instead of linear scoring

Linear scoring, by design, gives all records the same score past a
certain point.

This has the disadvantage that identical records that are very far away
cannot be sorted by distance.

By using exponential scoring, we can achieve decent sorting of even very
far away records. This is very helpful for cities and postalcodes.

Connects https://github.com/pelias/api/issues/1206
reset-focus-point-settings
Julian Simioni 6 years ago
parent
commit
a11242c763
No known key found for this signature in database
GPG Key ID: B9EEB0C6EE0910A1
  1. 2
      query/autocomplete_defaults.js
  2. 2
      query/search_defaults.js
  3. 2
      test/unit/fixture/autocomplete_linguistic_focus.js
  4. 2
      test/unit/fixture/autocomplete_linguistic_focus_null_island.js
  5. 2
      test/unit/fixture/search_linguistic_focus.js
  6. 2
      test/unit/fixture/search_linguistic_focus_bbox.js
  7. 2
      test/unit/fixture/search_linguistic_focus_bbox_original.js
  8. 2
      test/unit/fixture/search_linguistic_focus_null_island.js
  9. 2
      test/unit/fixture/search_linguistic_focus_null_island_original.js
  10. 2
      test/unit/fixture/search_linguistic_focus_original.js

2
query/autocomplete_defaults.js

@ -26,7 +26,7 @@ module.exports = _.merge({}, peliasQuery.defaults, {
'phrase:boost': 1,
'phrase:slop': 3,
'focus:function': 'linear',
'focus:function': 'exp',
'focus:offset': '0km',
'focus:scale': '250km',
'focus:decay': 0.5,

2
query/search_defaults.js

@ -26,7 +26,7 @@ module.exports = _.merge({}, peliasQuery.defaults, {
'phrase:boost': 1,
'phrase:slop': 2,
'focus:function': 'linear',
'focus:function': 'exp',
'focus:offset': '0km',
'focus:scale': '50km',
'focus:decay': 0.5,

2
test/unit/fixture/autocomplete_linguistic_focus.js

@ -32,7 +32,7 @@ module.exports = {
}
},
'functions': [{
'linear': {
'exp': {
'center_point': {
'origin': {
'lat': 29.49136,

2
test/unit/fixture/autocomplete_linguistic_focus_null_island.js

@ -32,7 +32,7 @@ module.exports = {
}
},
'functions': [{
'linear': {
'exp': {
'center_point': {
'origin': {
'lat': 0,

2
test/unit/fixture/search_linguistic_focus.js

@ -44,7 +44,7 @@ module.exports = {
'functions': [
{
'weight': 2,
'linear': {
'exp': {
'center_point': {
'origin': {
'lat': 29.49136,

2
test/unit/fixture/search_linguistic_focus_bbox.js

@ -55,7 +55,7 @@ module.exports = {
'functions': [
{
'weight': 2,
'linear': {
'exp': {
'center_point': {
'origin': {
'lat': 29.49136,

2
test/unit/fixture/search_linguistic_focus_bbox_original.js

@ -34,7 +34,7 @@ module.exports = {
}
},
'functions': [{
'linear': {
'exp': {
'center_point': {
'origin': {
'lat': 29.49136,

2
test/unit/fixture/search_linguistic_focus_null_island.js

@ -44,7 +44,7 @@ module.exports = {
'functions': [
{
'weight': 2,
'linear': {
'exp': {
'center_point': {
'origin': {
'lat': 0,

2
test/unit/fixture/search_linguistic_focus_null_island_original.js

@ -34,7 +34,7 @@ module.exports = {
}
},
'functions': [{
'linear': {
'exp': {
'center_point': {
'origin': {
'lat': 0,

2
test/unit/fixture/search_linguistic_focus_original.js

@ -34,7 +34,7 @@ module.exports = {
}
},
'functions': [{
'linear': {
'exp': {
'center_point': {
'origin': {
'lat': 29.49136,

Loading…
Cancel
Save