aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/cgi_pgsql.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-04-19 21:26:30 -0400
committerRalph Amissah <ralph@amissah.com>2011-04-19 21:26:30 -0400
commit5b647bdb5c8b3f1144911b08aa9c461f57f71ef5 (patch)
tree1864af6364291ba135a06e6729c2141f0ef64f1f /lib/sisu/v3/cgi_pgsql.rb
parentv3: screen_text_color (ansi colors) touched, consider reviewing later (diff)
v2 v3: cgi, sample-search-form
* results still not right, (ruby1.9.2 libraries? double check script) * not yet done variable directory path fixing for result links
Diffstat (limited to 'lib/sisu/v3/cgi_pgsql.rb')
-rw-r--r--lib/sisu/v3/cgi_pgsql.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sisu/v3/cgi_pgsql.rb b/lib/sisu/v3/cgi_pgsql.rb
index 3821f402..48211068 100644
--- a/lib/sisu/v3/cgi_pgsql.rb
+++ b/lib/sisu/v3/cgi_pgsql.rb
@@ -171,12 +171,12 @@ module SiSU_CGI_pgsql
end
def search_query1
<<-'WOK_SQL'
- @search_text,@search_endnotes=[],[]
- search[:text].each {|x| @search_text << "#{x} AND " }
- @search_text=@search_text.join.gsub!(/AND\s+$/,'') #watch
+ @search_text,@search_endnotes='',''
+ search[:text].flatten.each {|x| @search_text << "#{x} AND " }
+ @search_text=@search_text.gsub!(/AND\s+$/m,'') #watch
@search_text.gsub!(/(doc_objects\.clean~[*]?\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+doc_objects\.clean~[*]?\(\s*'[^']+'\s*\))+)/,'(\1)')
- search[:endnotes].each {|x| @search_endnotes << "#{x} AND " }
- @search_endnotes=@search_endnotes.join.gsub!(/AND\s+$/,'') #watch
+ search[:endnotes].flatten.each {|x| @search_endnotes << "#{x} AND " }
+ @search_endnotes=@search_endnotes.gsub!(/AND\s+$/m,'') #watch
@search_endnotes.gsub!(/(endnotes\.clean~\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean~\(\s*'[^']+'\s*\))+)/,'(\1)')
end
WOK_SQL