Searching from view on web

Hi AllI have a web application i have a search form on which i have 4 fields in which the user will enter the search formula i.e. values

I have view which contains all the fields as different column values

i want the user give the detailed search of all documents in the view depending upon the entries made by him

i have tried it using view.getalldocumentsbykey(searcharray,false)

but it is not working

also i have tried to search it on web & in this forum also but i can’t get it

any suggestions and help is highly appreciated

pl put any code if u can

thanx in advance

Sandy

Subject: Searching from view on web

Where did you put this code? NotesView.GetAllDocumentsByKey could be used to find all documents, that have those exact values in those exact fields (given that the order of columns is correct and that all columns are sorted). But it will return a NotesDocumentCollection and that won’t get you anywhere for displaying results to the user.

You could have an agent take this collection and print out all the required HTML for displaying the “result” to the user, but that would be a royal pain compared to really doing a fulltext search.

It would be a whole lot easier to just take the values from the input fields, build a search string like so

"[FirstField]=FirstValue&[SecondField]=SecondValue& … "

and then open a URL to search the view using the ?SearchView&query= URL command with the above parameters appended.

There are two downsides to consider: For this to work the database must have a fulltext index and the “equals” operator in the searchstring actually means “contains”.

Subject: Searching from view on web

Hey Sandy,

You can build a querystring-based logic for your application that follows this method:

view?searchview&query=[fieldname1]=value1&[fieldname2]=value2…

To do this, I’d suggest giving them a DHTML-based “prompt” that allows them to “build” said URL.

Field1

Now, for the JavaScript:

function advancedsearch(obj) {

window.location = “/someview?searchview&query=” + obj.name + “=” + escape(obj.value);

}

As for the formatting of the result set, check out the Designer Help file for $$SearchTemplate!

HTH,

-Chris