Web Searching

Hi,

I am creating a web site that contains hundreds of property documents.

I want users to be able to enter search criteria and display the relevent results within a view.

For now, I am just trying one field to get a result, if I manually type in the URL of the View, followed by ?SearchView&Query=“something” it pulls up the correct results in my $$searchtemplate default, which contains a view and navigation buttons.

“something” can be “[region] CONTAINS London” Where [region] is the field name and London is the value. All this works fine.

I am having problems automating this task so users simply complete a form with a few drop downs and press “Search”.

I have created a search form and put the relevant fields in here, which are all drop downs. As I said, I am only using one “region” at the moment to try and get it to work.

I have then created a Submit button and a $$return field. The button simply does @command(filesave) and @command(fileclose).

The $$return contains:

@URLOpen(dbpath := @ReplaceSubstring(@Subset(@DBName; -1); “\”; “/”);

PropFRRegion := PropFRRegion + " AND NOT [Description] CONTAINS " + PropFRRegion;

“[/” + DBPath + “/area?SearchView&Query=” + PropFRRegion + “]”)

However, when I am pressing the button, nothing is happening, it seems the $$return is not working, any ideas??

Many thanks,

Matt.

Subject: Web Searching

I have been using a search form that I copied from the old Notes.net 4.6 template and it works fine. I’m not sure if the code below will help, but possily it will give you some ideas.

To submit the document, the form uses:

@If(Query = “”;

@Return(“”);

@Do(@Command([FileSave]);

   @Command([FileCloseWindow]))

)

where “Query” is the field they type in the search words.

The $$Return is set like this:

Phrase := @If(MSWords = “1”;

           @ReplaceSubstring(Query;" ";" AND ");

MSWords = “2”;

				@ReplaceSubstring(Query;" ";" OR ");

			Query);

QuotedQuery := @URLEncode(“Domino”;@If(Phrase = “field”; @ReplaceSubstring(Phrase;“i”;“?”); Phrase));

ViewToSearch := @If(MSView = “”; “(this is where you can place a default view to search)”; @ReplaceSubstring(MSView; " "; “+”));

“[/” + @WebDbName + “/” + ViewToSearch + “?SearchView&Query=”+QuotedQuery+“&SearchOrder=”+@Text(Sort)+@If(MaxResults = “”; “”; “&SearchMax=”+@Text(MaxResults))+“&SearchWV=”+@If(SearchWV=“”;“FALSE”;“TRUE”) + “&SearchFuzzy=”+@If(UseSearchFuzzy=“”;“FALSE”;“TRUE”) + “&Start=” + @Text(Start) + “&Count=” + @Text(Count) + “]”

If you want, I can send you the forms (both Search and Search Results) in a database…

Let me know…

Hope this helps,

Dan

Thanks!

Dan

Subject: RE: Web Searching

Dan,

Thanks for your response.

I will have a play and let you know how I get on.

Matt.