developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks




PLEASE HELP... Adding FIELD and Contains to search
Matthew Robledo 12/05/2011 10:16 AM
General All Releases All Platforms


Hello,

I have the following search code behind a $$Return field. I want to search specific fields and am not sure how to add that to the query. There will be several fields that I will need to add to the query. Can someone help?

Thanks,

Here's my code:

REM {If nothing to search for return to search form!};
@If(@Trim(Query)=""&@Trim(SearchQuery)=""; @Return("[/"+@WebDbName + "/search]");"");

REM {Build the search};

searchfor:=@If(
QuickSearch="1"; Query;
@If(
SearchLookFor="1"; @ReplaceSubstring(@Trim(SearchQuery); " "; " AND ");
SearchLookFor="2"; @ReplaceSubstring(@Trim(SearchQuery); " "; " OR ");
SearchLookFor="3"; SearchQuery;
SearchQuery
)
);

options:=@If(QuickSearch="1"; "";
+@If(SearchWV="1"; "&SearchWV=TRUE"; "&SearchWV=FALSE")
+@If(SearchFuzzy="1"; "&SearchFuzzy=TRUE"; "&SearchFuzzy=FALSE")
);



"[/" + @WebDbName + "/srch?SearchView&Query=" + searchfor + "&count=25&SearchMax=0&SearchOrder=3" + options + "]"

Go back