I am trying to create a method of saving searches that produce no results on the web, so we can analyze what people are searching on but getting nowhere with.
At the moment my best idea is to have some code onload that runs if hits = 0.
Has anyone else done this so I don’t have to re-invent the wheel or else has anyone got a good method for creating docs on the web in the fashion i need ?
Thanks
Paul
Subject: create document onload on the web
Interesting.
I’m thinking you could conditionally call an agent if the hits are 0 using @toolsrunmacro and parse out the query section of the search string and write the value searched for off to a log with a date stamp and everything. Or not even to a log, to a csv file or somesuch and analyse it with Excel or whatever you liked offline.
HTH, George 
Subject: create document onload on the web
I did it the other way aroundI saved ALL searches, and if the results were >0 then deleted the search
Chris
Subject: RE: create document onload on the web
Thanks for that but it doesn’t work for me.
I can save the documents when the search terms are input but then there is no ‘hits’ figure at that point.
But equally when the results are viewed on the web they are a document in read mode and so they are not saved. Do you know a cheeky way to save the document after it has been loaded on the web ?
Thanks
Paul
Subject: RE: create document onload on the web
The process I used wasi) have a search form that generates an id for its documents
ii) save this when a user submits it and print the search URL with a link back to the ‘just saved’ document
iii) open the search in a $$searchtemplate form
iv) have a webqueryopen agent in the $$searchtemplate that checks if the number of hits is zero, if it is, ok, else find the document (from the link in the URL) and dlete it
Subject: RE: create document onload on the web
again thanks for that chris but we are currently monitoring all of our search documents so deleting all of those not needed isn’t an option - however do you think it would be possible to write the number of hits back to each document ? if so could you post your code to give me a head start ?
thanks
paul
Subject: RE: create document onload on the web
This is pseudo code off the top of my head, but here goes.the searchquery form has an id, say a CWC text field, value-@unique
The button saves the document
A WQS agent writes out the URL
(e.g.)
http://server//path/db.nsf?<>&queryID=<>
Now this displays in a $$searchtemplate form that has a WQO agent that interrogates the URL, gets the queryID, opens that docuemnt, and adds the resultsdoc.hits(0) value to it
Subject: create document onload on the web
In fact, thinking a bit more, if you’re using javascript and window.open etc to create the search URL, you could grab the query value from the input field and not have to parse it out at all.
George 