Index: openacs-4/packages/search/catalog/search.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/search/catalog/search.en_US.ISO-8859-1.xml,v diff -u -r1.4 -r1.5 --- openacs-4/packages/search/catalog/search.en_US.ISO-8859-1.xml 2 Feb 2005 21:29:13 -0000 1.4 +++ openacs-4/packages/search/catalog/search.en_US.ISO-8859-1.xml 20 Feb 2005 17:18:03 -0000 1.5 @@ -15,7 +15,7 @@ Try different keywords. Try more general keywords. Try your query on: %stw;noquote% - You must specify some keywords + You must specify some keywords. Display Next Search is not currently configured. Please contact the webmaster to enable it. Index: openacs-4/packages/search/tcl/search-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/search/tcl/search-procs.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/search/tcl/search-procs.tcl 5 Feb 2005 11:53:57 -0000 1.17 +++ openacs-4/packages/search/tcl/search-procs.tcl 20 Feb 2005 17:18:03 -0000 1.18 @@ -57,6 +57,7 @@ delete the entry. @author Neophytos Demetriou + @author Jeff Davis } { set driver [ad_parameter -package_id [apm_package_id_from_key search] FtsEngineDriver] @@ -69,21 +70,25 @@ return } - db_foreach search_observer_queue_entry {} { + # JCD: pull out the rows all at once so we release the handle + foreach row [db_list_of_lists search_observer_queue_entry {}] { + foreach {object_id event_date event} $row { break } + array unset datasource switch -- $event { INSERT { # Don't bother reindexing if we've already inserted/updated this object in this run if {![info exists seen($object_id)]} { set object_type [acs_object_type $object_id] if {[acs_sc_binding_exists_p FtsContentProvider $object_type]} { + array set datasource {mime {} storage_type {} keywords {}} array set datasource [acs_sc_call FtsContentProvider datasource [list $object_id] $object_type] if {$syndicate} { search::syndicate -datasource datasource } search::content_get txt $datasource(content) $datasource(mime) $datasource(storage_type) - acs_sc_call FtsEngineDriver index [list $datasource(object_id) $txt $datasource(title) $datasource(keywords)] $driver - array unset datasource + acs_sc_call FtsEngineDriver index \ + [list $datasource(object_id) $txt $datasource(title) $datasource(keywords)] $driver } # Remember seeing this object so we can avoid reindexing it later set seen($object_id) 1 @@ -93,7 +98,7 @@ acs_sc_call FtsEngineDriver unindex [list $object_id] $driver db_dml nuke_syn {delete from syndication where object_id = :object_id} # unset seen since you could conceivably delete one but then subsequently - # insert it (eg when rolling back/forward the live revision). + # reinsert it (eg when rolling back/forward the live revision). if {[info exists seen($object_id)]} { unset seen($object_id) } @@ -103,13 +108,13 @@ if {![info exists seen($object_id)]} { set object_type [acs_object_type $object_id] if {[acs_sc_binding_exists_p FtsContentProvider $object_type]} { + array set datasource {mime {} storage_type {} keywords {}} array set datasource [acs_sc_call FtsContentProvider datasource [list $object_id] $object_type] search::content_get txt $datasource(content) $datasource(mime) $datasource(storage_type) if {$syndicate} { search::syndicate -datasource datasource } acs_sc_call FtsEngineDriver update_index [list $datasource(object_id) $txt $datasource(title) $datasource(keywords)] $driver - array unset datasource } # Remember seeing this object so we can avoid reindexing it later set seen($object_id) 1 @@ -217,9 +222,16 @@ } { upvar $datasource d - if {![info exists d(syndication)]} { + if {![info exists d(syndication)]} { return - } + } + + array set syn { + category {} + author {} + guid {} + } + array set syn $d(syndication) set object_id $d(object_id) Index: openacs-4/packages/search/www/advanced-search.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/search/www/advanced-search.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/search/www/advanced-search.adp 2 Feb 2005 21:18:03 -0000 1.4 +++ openacs-4/packages/search/www/advanced-search.adp 20 Feb 2005 17:18:03 -0000 1.5 @@ -5,7 +5,7 @@
- #search.Date_Range# +

#search.Date_Range# +

Index: openacs-4/packages/search/www/search.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/search/www/search.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/search/www/search.adp 2 Feb 2005 21:18:03 -0000 1.5 +++ openacs-4/packages/search/www/search.adp 20 Feb 2005 17:18:03 -0000 1.6 @@ -1,94 +1,100 @@ @page_title@ @context;noquote@ + t - - + } + .result { + margin: 1em 0 0 0; + padding: 0 0 0 1em; + border-left: 3px solid grey; + } + .result b { + background: yellow; + padding: 0 3px; + } + +
-

#search.Advanced_Search#

- -

#search.Tip_In_most_browsers_return#

-
+

#search.Advanced_Search#

+ +

#search.lt_You_must_specify_some#

+
+ +

#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 }