matthias-samwald / find-me-evidence

An open-source medical search engine
GNU Affero General Public License v3.0
9 stars 1 forks source link

Make negation in query string work #13

Open matthias-samwald opened 10 years ago

matthias-samwald commented 10 years ago

The query >ketogenic diet< gives 302 results The query >ketogenic diet -epilepsy< gives 14163 results

The user would expect that the second query yiels LESS results, because the '-epilepsy' is usually meant to exclude terms from the result set (and therefore decreasing the number of results). We need to make negation work.

This probably has to do with the Solr query parser etc... maybe we should wait with thinking about this problem after we have updated everything to the latest version of Solr, maybe results are different by then anyways.

gpetz commented 10 years ago

the query >+ketogenic +diet -epilepsy< does what we are expecting because mm isn't applied on top-level clauses, this is an ongoing discussion, how edismax should deal with operators: https://issues.apache.org/jira/browse/SOLR-2649 Created: 12/Jul/11 13:13 :-1: the proposed custom edismax query parser fails to instantiate org.apache.solr.search.QParserPlugin, I also wouldn't recommend to use our own query parser

NB: the query >ketogenic diet -epilepsy< gives you ketogenic or diet but not epilepsy!