Skip to content

Commit

Permalink
chore: tune query
Browse files Browse the repository at this point in the history
Properly configured phrase query boosts exact matches
  • Loading branch information
vesameskanen committed Jan 8, 2022
1 parent 69544b8 commit 1d958f6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pelias.json.docker
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}
},
"textAnalyzer": "libpostal",
"sizePadding": 7,
"sizePadding": 9,
"minConfidence": 0.8,
"relativeMinConfidence": 0.8,
"languageMatchThreshold": 0.9,
Expand Down
2 changes: 1 addition & 1 deletion query/fuzzy.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ query.score( peliasQuery.view.address('street') );
query.score( peliasQuery.view.address('postcode') );

// admin components
query.score( peliasQuery.view.admin_multi_match(adminFields, 'peliasAdmin') );
query.score( peliasQuery.view.admin_multi_match(adminFields, 'peliasIndexOneEdgeGram') );
query.score( views.custom_boosts( config.customBoosts ) );

// non-scoring hard filters
Expand Down
2 changes: 2 additions & 0 deletions query/search_original.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ function generateQuery( clean ){

// input text
vs.var( 'input:name', clean.text );
vs.var('phrase:multifield', ['phrase.*']);
vs.var('phrase:type', 'phrase');

// sources
if( _.isArray(clean.sources) && !_.isEmpty(clean.sources) ) {
Expand Down

0 comments on commit 1d958f6

Please sign in to comment.