From 100e4ddbd35b9ce7ee296be1e1d582b4c4832041 Mon Sep 17 00:00:00 2001 From: randomdan Date: Thu, 10 Feb 2011 22:01:17 +0000 Subject: Allow searching for bugs as well as packages --- gentoobrowse/present/search.xml | 55 ++++++++++++++++++++++++++++++++--------- gentoobrowse/search.xslt | 41 +++++++++++++++++++++++------- gentoobrowse/views/search.xml | 13 ++++++++++ 3 files changed, 89 insertions(+), 20 deletions(-) diff --git a/gentoobrowse/present/search.xml b/gentoobrowse/present/search.xml index de448f3..cb48280 100644 --- a/gentoobrowse/present/search.xml +++ b/gentoobrowse/present/search.xml @@ -3,15 +3,48 @@ xmlns:project2="http://project2.randomdan.homeip.net"> - -
- -
-
- - - - - + + + + + + +
+ +
+
+
+ + + + + + + + + + + + + + + + +
+ +
+
+
+ + + + + + + + + + diff --git a/gentoobrowse/search.xslt b/gentoobrowse/search.xslt index 063c0b7..06bd5b7 100644 --- a/gentoobrowse/search.xslt +++ b/gentoobrowse/search.xslt @@ -9,18 +9,41 @@ + - - -

Search Results for ""

-
    - -
+ + +

Search Results for ""

+
    + +
+
+ +

Nothing found

+
- -

Nothing found

+
+ + + +

Search Results for ""

+ +
+ +

Nothing found

+
-
diff --git a/gentoobrowse/views/search.xml b/gentoobrowse/views/search.xml index 820c3ea..87ce6eb 100644 --- a/gentoobrowse/views/search.xml +++ b/gentoobrowse/views/search.xml @@ -18,4 +18,17 @@ + + + SELECT b.bugid, b.severity, b.status, b.summary, b.firstseen + , + ts_rank(to_tsvector('english', regexp_replace(summary, '-[0-9][^ ]*', '', 'g')), plainto_tsquery('english', )) as rank + + FROM bugs b + + WHERE to_tsvector('english', regexp_replace(summary, '-[0-9][^ ]*', '', 'g')) @@ plainto_tsquery('english', ) + ORDER BY rank DESC, bugid DESC + + + -- cgit v1.2.3