Lotusscript Equivalent of URL QueryString

I have a web based app that passes a query string when a user chooses their search variables eg:Query=teams&start=1&count=25&SearchFuzzy=TRUE&SearchWV=TRUE. My client wants to be able to search within these search results when they come up. In a previous posting, it was suggested that I could run Lotusscript against the document collection to search within the results. But since the web doesn’t store the results I would need to rerun the search and then the search within the search. I understand the concept, but can’t figure out how to translate the querystring above into a format that Lotusscript could use? Or is there an easier way of doing a search within a search?

Subject: Lotusscript Equivalent of URL QueryString

If you are showing a form to the user just make sure it includes a field named QUERY_STRING. When served on the web, this field will contain the contents of the query string. Then all you gotta do is run a couple layers of split on it to get all your values:

varKeyValuePairs = split(queryString, “&”)

forall x in varKeyValuePairs

varKeyValuePair = split(x, “=”)

’ do something

end forall

or something. You get the idea.

Subject: RE: Lotusscript Equivalent of URL QueryString

Thanks Jeremiah. I understand how to parse it out. But then after I run it and get my doc collection and then run the other search against it, how do I display the final results? Do I store the results in a field? On the web page I’m currently using a $$ViewBody. Is this where I write my results? How do I build my URLs around the docs returned?

Subject: RE: Lotusscript Equivalent of URL QueryString

Whups. Sorry about that, I had trouble deciding what the question actually was from your post. I see David has pretty much touched on what I’d do (store previous query in hidden field), so do that. :slight_smile:

Subject: RE: Lotusscript Equivalent of URL QueryString

  • Store your query for View filtering (searching, whatever) in a hidden field on your (custom) web search form. When the user submits the search, rebuild the query using the new information, and the old cached information, then store it back in that field. Just make sure to include a way for the use to perform a search that clears this hidden data, so every search for that session is limited by the cached value.- I always use custom search forms and LS/FTSearch to do web searches. This sort of thing is very simple then. I’ve actually never used $$ViewBody, so I can’t recommend how to use that with a refinable search mechanism.

  • Alternative you can put the previous criteria in an URL arg, but that A) makes the URL really long and B) exposes it to user manipulation, so your search code should validate the query before attempting to employ it. It has the advantage that bookmarking the URL will also bookmark the search criteria, which can be handy.

  • Hope this helps…

Subject: RE: Lotusscript Equivalent of URL QueryString

Thanks David for your response. The only question I have is how do you display your results when you use LS/FTSearch? My results currently are shown in $$SearchTemplateDefault in the $$Viewbody field. How do you currently show results for the web?