Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pelias-query

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pelias-query - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

2

package.json
{
"name": "pelias-query",
"version": "2.0.0",
"version": "3.0.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

module.exports = function( types ){
module.exports = function( subview ){
return function( vs ){
// query section reduces the number of records which
// the decay function is applied to.
// we simply re-use the another view for the function query.
if( !subview ){ return null; } // subview validation failed
// validate required params

@@ -15,18 +20,3 @@ if( !vs.isset('popularity:field') ||

function_score: {
query: {
'filtered': {
'filter': {
'exists': {
'field': vs.var('popularity:field')
}
}
}
},
// filter: {
// 'or': [
// { 'type': { 'value': 'admin0' } },
// { 'type': { 'value': 'admin1' } },
// { 'type': { 'value': 'admin2' } }
// ]
// },
query: subview( vs ),
max_boost: vs.var('popularity:max_boost'),

@@ -36,14 +26,10 @@ functions: [],

boost_mode: 'replace',
filter: {
'exists': {
'field': vs.var('popularity:field')
}
}
}
};
// a list of _types to target
if( Array.isArray( types ) ){
view.function_score.filter = {
or: types.map( function( type ){
return { type: { value: type } };
})
};
}
view.function_score.functions.push({

@@ -59,2 +45,2 @@ field_value_factor: {

};
};
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc