Browse Source

fix: Merge pull request #701 from pelias/add-boosts-to-defaults

Add boosts to defaults
pull/702/head v3.5.2
Stephen K Hess 8 years ago committed by GitHub
parent
commit
a7d7364190
  1. 2
      package.json
  2. 2
      query/search.js
  3. 5
      query/search_defaults.js
  4. 13
      test/unit/fixture/search_boundary_country.js
  5. 12
      test/unit/fixture/search_fallback.js
  6. 13
      test/unit/fixture/search_linguistic_bbox.js
  7. 13
      test/unit/fixture/search_linguistic_focus.js
  8. 13
      test/unit/fixture/search_linguistic_focus_bbox.js
  9. 13
      test/unit/fixture/search_linguistic_focus_null_island.js
  10. 13
      test/unit/fixture/search_linguistic_only.js
  11. 13
      test/unit/fixture/search_linguistic_viewport.js
  12. 13
      test/unit/fixture/search_linguistic_viewport_min_diagonal.js
  13. 11
      test/unit/fixture/search_with_category_filtering.js
  14. 11
      test/unit/fixture/search_with_source_filtering.js

2
package.json

@ -55,7 +55,7 @@
"pelias-config": "2.3.0",
"pelias-logger": "0.1.0",
"pelias-model": "4.3.0",
"pelias-query": "8.7.0",
"pelias-query": "8.8.0",
"pelias-text-analyzer": "1.4.0",
"stats-lite": "2.0.3",
"through2": "2.0.1"

2
query/search.js

@ -59,7 +59,7 @@ function generateQuery( clean ){
// size
if( clean.querySize ) {
vs.var( 'size', 50 );
vs.var( 'size', clean.querySize );
}
// focus point

5
query/search_defaults.js

@ -92,6 +92,9 @@ module.exports = _.merge({}, peliasQuery.defaults, {
'population:field': 'population',
'population:modifier': 'log1p',
'population:max_boost': 20,
'population:weight': 2
'population:weight': 2,
'boost:address': 10,
'boost:street': 5
});

13
test/unit/fixture/search_boundary_country.js

@ -9,6 +9,7 @@ module.exports = {
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
@ -73,19 +74,9 @@ module.exports = {
'boost_mode': 'multiply'
}
},
'size': 50,
'size': 10,
'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
};

12
test/unit/fixture/search_fallback.js

@ -98,6 +98,7 @@ module.exports = {
{
'bool': {
'_name': 'fallback.address',
'boost': 10,
'must': [
{
'match_phrase': {
@ -195,6 +196,7 @@ module.exports = {
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
@ -790,16 +792,6 @@ module.exports = {
'size': 20,
'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
};

13
test/unit/fixture/search_linguistic_bbox.js

@ -9,6 +9,7 @@ module.exports = {
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
@ -76,19 +77,9 @@ module.exports = {
'boost_mode': 'multiply'
}
},
'size': 50,
'size': 10,
'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
};

13
test/unit/fixture/search_linguistic_focus.js

@ -9,6 +9,7 @@ module.exports = {
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
@ -79,19 +80,9 @@ module.exports = {
'boost_mode': 'multiply'
}
},
'size': 50,
'size': 10,
'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
};

13
test/unit/fixture/search_linguistic_focus_bbox.js

@ -9,6 +9,7 @@ module.exports = {
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
@ -90,19 +91,9 @@ module.exports = {
'boost_mode': 'multiply'
}
},
'size': 50,
'size': 10,
'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
};

13
test/unit/fixture/search_linguistic_focus_null_island.js

@ -9,6 +9,7 @@ module.exports = {
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
@ -79,19 +80,9 @@ module.exports = {
'boost_mode': 'multiply'
}
},
'size': 50,
'size': 10,
'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
};

13
test/unit/fixture/search_linguistic_only.js

@ -9,6 +9,7 @@ module.exports = {
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
@ -65,19 +66,9 @@ module.exports = {
'boost_mode': 'multiply'
}
},
'size': 50,
'size': 10,
'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
};

13
test/unit/fixture/search_linguistic_viewport.js

@ -9,6 +9,7 @@ module.exports = {
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
@ -65,19 +66,9 @@ module.exports = {
'boost_mode': 'multiply'
}
},
'size': 50,
'size': 10,
'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
};

13
test/unit/fixture/search_linguistic_viewport_min_diagonal.js

@ -9,6 +9,7 @@ module.exports = {
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
@ -65,19 +66,9 @@ module.exports = {
'boost_mode': 'multiply'
}
},
'size': 50,
'size': 10,
'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
};

11
test/unit/fixture/search_with_category_filtering.js

@ -9,6 +9,7 @@ module.exports = {
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
@ -69,16 +70,6 @@ module.exports = {
'size': 20,
'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
};

11
test/unit/fixture/search_with_source_filtering.js

@ -9,6 +9,7 @@ module.exports = {
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
@ -68,16 +69,6 @@ module.exports = {
'size': 20,
'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
};

Loading…
Cancel
Save