From fd2b1cc03719dbf0c8f829a3e6ec37cdff6f21b2 Mon Sep 17 00:00:00 2001 From: preecej Date: Fri, 15 Jul 2011 18:24:00 +0000 Subject: [PATCH] Added a max return count of 50, filtered out OBSOLETE terms and any terms not affiliated with the two branches of the PO (anatomy, and growth & development stages). svn path=/; revision=121 --- preecej/semantic_wiki/prototyping/TermSearch_JSON.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/preecej/semantic_wiki/prototyping/TermSearch_JSON.php b/preecej/semantic_wiki/prototyping/TermSearch_JSON.php index ab57a6a..e57cd89 100644 --- a/preecej/semantic_wiki/prototyping/TermSearch_JSON.php +++ b/preecej/semantic_wiki/prototyping/TermSearch_JSON.php @@ -15,6 +15,7 @@ if(isset($_GET['user']) && ($_GET['user']) == 'paw') { : die('"field" is a required parameter and must match an available data field.'); $number_of_terms = isset($_GET['max']) ? intval($_GET['max']) : 10; //10 is the default + if ($number_of_terms > 50) { $number_of_terms = 50; } $qval = $_GET['qval']; @@ -36,6 +37,7 @@ if(isset($_GET['user']) && ($_GET['user']) == 'paw') { $query = "SELECT t.$field FROM term t" . " LEFT JOIN term_definition d ON d.term_id = t.id" . " WHERE t.$field LIKE '%$qval%'" + . " AND t.term_type in ('plant_anatomy','plant_growth_and_development_stage')" . " AND UCASE(t.name) NOT LIKE 'OBSOLETE%'" . " AND UCASE(d.term_definition) NOT LIKE 'OBSOLETE%'" . " ORDER BY name LIMIT $number_of_terms"; -- 2.34.1