Skip to content

Commit

Permalink
Merge pull request #164 from Open-Earth-Foundation/ON-390
Browse files Browse the repository at this point in the history
fix(390): search api not showing full results for type-ahead stems
  • Loading branch information
cephaschapa committed Jun 14, 2023
2 parents 49aac45 + 22c46c4 commit de1f086
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/routes/search.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ router.get(
query: {
bool: {
should: [
{ match_phrase: { name: { query: q, boost: 1.0 } } },
{ match_phrase: { identifier: { query: q, boost: 1.0 } } },
{ match_phrase_prefix: { name: { query: q, boost: 1.0 } } },
{ match_phrase_prefix: { identifier: { query: q, boost: 1.0 } } },
{ match: { type: { query: "country", boost: 1.1 } } },
{ match: { type: { query: "adm1", boost: 1.07 } } },
{ match: { type: { query: "adm2", boost: 1.04 } } },
Expand Down Expand Up @@ -129,6 +129,7 @@ router.get(
},
},
],
minimum_should_match: 1
},
},
boost_mode: "multiply",
Expand All @@ -139,7 +140,7 @@ router.get(
},
},
};

const ActorIDS = await client.search({
index: indexName,
body: query,
Expand Down

0 comments on commit de1f086

Please sign in to comment.