wellcometrust / reach

Wellcome tool to parse references scraped from policy documents using machine learning
MIT License
25 stars 4 forks source link

Fix an issue where user couldn't search multiple words #396

Closed SamDepardieu closed 4 years ago

SamDepardieu commented 4 years ago

Description

This PR fix #381 by splitting the terms of the queries by spaces before querying the database. This behaviour is due to ES way of querying texts (see match queries vs term query -> https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html#avoid-term-query-text-fields ).

This PR also now tests for the query builder to generate a correct set of terms for the queried field if the query included spaces (aka was a sentence)

Type of change

How Has This Been Tested?

Local runs New tests make docker-test