+
+ #search.and_not_needed# [#search.details#]
+
+
+ #search.lt_bstopwordsb_is_a_very# [#search.details#]
+
+
+ #search.lt_The_following_words_a# [#search.details#]
+
-
- #search.and_not_needed# [#search.details#]
-
-
- #search.lt_bstopwordsb_is_a_very# [#search.details#]
-
-
- #search.lt_The_following_words_a# [#search.details#]
-
+
+
+
+ #search.Untitled#
+
+
+
+
+
+ @searchresult.txt_summary;noquote@
+
+
@searchresult.url_one@
+
+
-
-
-
- #search.Untitled#
-
-
-
-
-
- @searchresult.txt_summary;noquote@
-
-
@searchresult.url_one@
-
-
+
+ #search.lt_No_pages_were_found_c#
+ #search.Suggestions#
+
+ - #search.lt_Make_sure_all_words_a#
+ - #search.lt_Try_different_keyword#
+ - #search.lt_Try_more_general_keyw#
+
+ - #search.Try_fewer_keywords#
+
+
+
+
+ #search.Searched_for_query#
+ #search.Results_count#
+
-
- #search.lt_No_pages_were_found_c#
- #search.Suggestions#
-
- - #search.lt_Make_sure_all_words_a#
- - #search.lt_Try_different_keyword#
- - #search.lt_Try_more_general_keyw#
-
- - #search.Try_fewer_keywords#
-
-
-
-
- #search.Searched_for_query#
- #search.Results_count#
-
+
+
+ #search.Result_page#
+
+ #search.Previous#
+
+ @choice_bar;noquote@
+
+ #search.Next#
+
+
+
+
+
+
+
-
-
- #search.Result_page#
-
- #search.Previous#
+
+ #search.lt_Try_your_query_on_stw#
- @choice_bar;noquote@
-
- #search.Next#
-
-
-
-
-
-
-
-
-
- #search.lt_Try_your_query_on_stw#
-
+
Index: openacs-4/packages/search/www/search.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/search/www/search.tcl,v
diff -u -r1.14 -r1.15
--- openacs-4/packages/search/www/search.tcl 2 Feb 2005 21:18:03 -0000 1.14
+++ openacs-4/packages/search/www/search.tcl 20 Feb 2005 17:18:03 -0000 1.15
@@ -3,15 +3,13 @@
@creation-date September 01, 2001
@cvs-id $Id$
} {
- q:notnull,trim
+ q:trim
{t:trim ""}
{offset:integer 0}
{num:integer 0}
{dfs:trim ""}
{dts:trim ""}
-} -errors {
- q:notnull {[_ search.lt_You_must_specify_some].}
-}
+}
set page_title "Search Results"
@@ -27,29 +25,43 @@
set driver [ad_parameter -package_id $package_id FtsEngineDriver]
array set info [acs_sc_call FtsEngineDriver info [list] $driver]
+
if { [array get info] == "" } {
ReturnHeaders
ns_write "[_ search.lt_FtsEngineDriver_not_a]"
ad_script_abort
}
+if {[string is space $q] } {
+ set query {}
+ set empty_p 1
+ set url_advanced_search "advanced-search"
+ ad_return_template
+ return
+} else {
+ set empty_p 0
+}
+
+
+
+
if { $num <= 0} {
set limit [ad_parameter -package_id $package_id LimitDefault]
} else {
set limit $num
}
-
set df ""
set dt ""
if { $dfs == "all" } { set dfs "" }
array set symbol2interval [ad_parameter -package_id $package_id Symbol2Interval]
if { $dfs != "" } { set df [db_exec_plsql get_df "select now() + '$symbol2interval($dfs)'::interval"] }
if { $dts != "" } { set dt [db_exec_plsql get_dt "select now() + '$symbol2interval($dts)'::interval"] }
-
set q [string tolower $q]
set urlencoded_query [ad_urlencode $q]
+set qtest [tsearch2::build_query -query $q]
+
if { $offset < 0 } { set offset 0 }
set t0 [clock clicks -milliseconds]
array set result [acs_sc_call FtsEngineDriver search [list $q $offset $limit $user_id $df $dt] $driver]
@@ -95,12 +107,12 @@
set title_summary [acs_sc_call FtsEngineDriver summary [list $q $datasource(title)] $driver]
set txt_summary [acs_sc_call FtsEngineDriver summary [list $q $txt] $driver]
set url_one [acs_sc_call FtsContentProvider url [list $object_id] $object_type]
-
+
# Replace the "index" with ETP as this is not needed for accessing the page
if {[string equal $object_type "etp_page_revision"]} {
set url_one [string trimright $url_one "index"]
}
- template::multirow append searchresult $title_summary $txt_summary $url_one
+ template::multirow append searchresult $title_summary $txt_summary $url_one
}