From 53b8092bbe0dcc93c2718dbf9fcbff59a9e6f3e6 Mon Sep 17 00:00:00 2001 From: Rory Drysdale Date: Wed, 25 Jun 2014 15:05:39 -0700 Subject: [PATCH] Fixes #44. English name search now only shows the first instance of the matching items. --- app/controllers/addPlotObservation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/addPlotObservation.js b/app/controllers/addPlotObservation.js index b75cca1..b30f106 100644 --- a/app/controllers/addPlotObservation.js +++ b/app/controllers/addPlotObservation.js @@ -492,7 +492,7 @@ function auto_complete(search_term) { var rsGenus = db.execute('SELECT genus_name FROM genus WHERE UPPER(genus_name) LIKE UPPER(?)', search_term + '%'); totalRowCount += rsGenus.getRowCount(); - var rsEnglish = db.execute('SELECT english_name ' + 'FROM species ' + 'WHERE UPPER(english_name) LIKE UPPER(?)', search_term + '%'); + var rsEnglish = db.execute('SELECT DISTINCT english_name ' + 'FROM species ' + 'WHERE UPPER(english_name) LIKE UPPER(?)', search_term + '%'); totalRowCount += rsEnglish.getRowCount(); var rsScientific = db.execute('SELECT s.species_code, g.genus_name || " " || s.species_name AS scientific_name \