Hallo,
ich habe einmal eine Suchmaske mit der Eingabemöglichkeit von bis zu drei in sich geklammerten Querystrings, die selbst wieder eine Teil-Query enthalten dürfen und zwei Operatoren gemacht und in dem SEARCH-Button dann den unten stehenden CODE eingebaut:
path := @WebDbName;
_phrase1:=@Left(@Right(Query1;@Char(34));@Char(34));
_q1:=@Trim(@ReplaceSubstring(Query1;_phrase1;"$phrase$"));
_query1:=@ReplaceSubstring(_q1;" -";"+AND+NOT+");
_query1a:=@ReplaceSubstring(_query1;", ";"+OR+");
_query1b:=@ReplaceSubstring(_query1a;" ";"+AND+");
_query1c:=@ReplaceSubstring(_query1b;"$phrase$";_phrase1);
_phrase2:=@Left(@Right(Query2;@Char(34));@Char(34));
_q2:=@Trim(@ReplaceSubstring(Query2;_phrase2;"$phrase$"));
_query2:=@ReplaceSubstring(_q2;" -";"+AND+NOT+");
_query2a:=@ReplaceSubstring(_query2;", ";"+OR+");
_query2b:=@ReplaceSubstring(_query2a;" ";"+AND+");
_query2c:=@ReplaceSubstring(_query2b;"$phrase$";_phrase2);
_phrase3:=@Left(@Right(Query3;@Char(34));@Char(34));
_q3:=@Trim(@ReplaceSubstring(Query3;_phrase3;"$phrase$"));
_query3:=@ReplaceSubstring(_q3;" -";"+AND+NOT+");
_query3a:=@ReplaceSubstring(_query3;", ";"+OR+");
_query3b:=@ReplaceSubstring(_query3a;" ";"+AND+");
_query3c:=@ReplaceSubstring(_query3b;"$phrase$";_phrase3);
_xoperator1:=@If(@Trim(Query2)="";"";d_Operator1);
_xoperator2:=@If(@Trim(Query3)="";"";d_Operator2);
_Query:=@If(_xOperator1="";_query1c;
"("+_query1c+")+"+_xOperator1+"+("+_query2c+")")
+@If(_xOperator2="";"";"+"+_xOperator2+"+("+_query3c+")");
@If(_Query="";
@Return("")
;
@Do(
@SetTargetFrame("view");
@URLOpen ( "/" +
path +
"/" + searchView + "/?SearchView&Query=" + _Query +
"&SearchOrder=" + @Text ( SortOrder ) +
"&SearchMax=" + @Text ( MaxResults ) +
"&SearchWV=" + @If ( WordVariants = ""; "FALSE" ; "TRUE") +
"&SearchThesaurus=" + @If ( UseThesaurus = ""; "FALSE"; "TRUE" ) +
"&SearchFuzzy=" + @If(FuzzySearch = ""; "FALSE" ; "TRUE")
)
)
)
Ist es das, was du suchst ?
Gruß
Norbert