Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/controllers/v1/taxa_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,20 @@ TaxaController.search = async req => {
}
} );
searchReq.query.highlight.fields["names.name_autocomplete_ja"] = { };
} else if ( params.exact === "true" ) {
filters.push( {
nested: {
path: "names",
query: {
match: {
"names.exact_ci": {
query: params.q
}
}
}
}
} );
searchReq.query.highlight.fields["names.exact_ci"] = { };
} else {
filters.push( {
nested: {
Expand Down
4 changes: 4 additions & 0 deletions lib/views/swagger_v1.yml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -1750,6 +1750,10 @@ paths:
type: boolean
in: query
description: Taxon is `active`
- name: exact
type: boolean
in: query
description: If true, only return exact string matches
- name: id
type: array
items:
Expand Down