[ic] Searchspecs leaking in coordinated search

John A. john at virginiaquilter.com
Sat Aug 14 12:52:30 UTC 2010


I have a search bar across the top of all my pages, with a drop-down
to select the department (product_class column) to search.

Per the official & rtfm documentation, and what I can find in the
archives, this should work. It doesn't, quite. As I understand it, the
first se should be searched for in the fields in the first sf, while
the second se should be searched for in the fields in the second sf.
They are not limiting themselves. In a test search within one
department I got the expected results from within that department,
plus another item that happened to have the department name in its
description. It seems it's searching for everything everywhere.

I'm wondering if I'm doing something wrong here. Here's my code.

I've tried formatting the second se with and without the leading
colon, and with colons instead of commas; it doesn't seem to make the
desired difference.

I also found mention in the archives of the apparently undocumented
mv_search_map. Is that something that might help? It looks like it
just lets you give the form elements different names while still
having the searchspecs all come through as searchspecs so I'm guessing
it might make no difference here.

I'm wondering also if I could do it with a simple post form
interpreted by an in-page search on just the department, with a ref
search narrowing it against the user's search terms.

Anyway, the code...

<form action="[area search]" method=post>[form-session-id]
<td ALIGN=right VALIGN=center BGCOLOR="#CDBE9D" class="crossbar"
width=20>Search:</td>
<td align=center VALIGN=center BGCOLOR="#CDBE9D" class="crossbar"
width=20>
	[tmp cat_widget]
		[display
			name=se
			type=select
			options="=-[L]all departments[/L]-"
			lookup_query="select distinct product_class from products where not
product_class = '' order by product_class"
			default="[scratch searchcat]"
		]
	[/tmp]
	[scratch cat_widget]
</td>
<td align=left VALIGN=center BGCOLOR="#CDBE9D" class="crossbar"
style="width:100%;">
<input type=text name=se size=50 style="width:100%;" [if scratch
searchtarget]value="[scratch searchtarget]"[/if]>
	<input type=hidden name=st value=db>
	<input type=hidden name=sf value=":product_class">
	<input type=hidden name=sf
value=":sku,short_description,description,category,designer,colors,themelist,patthemelist,keywords,thumb">
	<input type=hidden name=ml value=50>
	<input type=hidden name=co value=1>
	<input type=hidden name=fc value=1>
	<input type=hidden name=su value=0>
	<input type=hidden name=su value=1>
	<input type=hidden name=tf value=category>
	[if module-version Text::Query]
	<input type=hidden name=op value=eq>
	<input type=hidden name=op value=aq>
	[else]
	<input type=hidden name=op value=eq>
	<input type=hidden name=op value=rm>
	[/else]
	[/if]
</td>
<td align=left VALIGN=center width=13 BGCOLOR="#CDBE9D"
class="crossbar">
<input src="/images/SearchTan3.png" alt="Go" type="image">
[comment]<input type=submit value="[L]Go[/L]" class=button3>[/comment]
</td>
</form>



More information about the interchange-users mailing list