<div dir="ltr"><div class="gmail_extra"><div class="gmail_extra">> In case I wasn't clear: I don't think you have to modify the command</div><div class="gmail_extra">> at all. Just create a template that uses the command as it currently</div><div class="gmail_extra">> works.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I thought we needed a new template only for the second log file? To</div><div class="gmail_extra">generate the first log file using the existing $log command, I have</div><div class="gmail_extra">introduced another $log command in query template that looks like:</div><div class="gmail_extra"><br></div><div class="gmail_extra">$log{search.log,"$qid{$query}\t$query\t$did\t$topdoc"}</div><div class="gmail_extra"><br></div><div class="gmail_extra">- search.log: log file name in log_dir (var/log/omega)</div><div class="gmail_extra">- $qid{$query}: to return query id for the given query. Planning to</div><div class="gmail_extra">  use the existing MD5 implementation here as you pointed out.</div><div class="gmail_extra">- $query: existing command that returns query text.</div><div class="gmail_extra">- $did: to return a list of doc ids on the result page. I'm aware of</div><div class="gmail_extra">  $id command that returns doc id of the "current" doc but not sure</div><div class="gmail_extra">  what current doc means there.</div><div class="gmail_extra">- $topdoc: existing command to set offset value.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I'm currently working towards implementing the support for new</div><div class="gmail_extra">commands i.e. $qid and $did.</div><div class="gmail_extra"><br></div><div class="gmail_extra">An example log entry assuming that we allow only 4 docs on a</div><div class="gmail_extra">single result page:</div><div class="gmail_extra"><br></div><div class="gmail_extra">q101 "simple query text" [doc0, doc1, doc2, doc3] 0  </div><div class="gmail_extra">q101 "simple query text" [doc4, doc5, doc6, doc7] 4</div><div class="gmail_extra">q101 "simple query text" [doc8, doc9, doc10, doc11] 8</div><div class="gmail_extra"><br></div><div class="gmail_extra">qid taken to be very simple for the purpose of this example and</div><div class="gmail_extra">I'm not really sure about the doc id format so assumed it to be</div><div class="gmail_extra">like that.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Also, I noticed that the existing log command in query template i.e.</div><div class="gmail_extra">$log{query.log} doesn't really log anything. I created query.log in</div><div class="gmail_extra">log_dir as specified in omega.conf with read and write permission</div><div class="gmail_extra">granted to the current system user but I see no logs in that file.</div><div class="gmail_extra">Should the log command be included inside the html body for it to</div><div class="gmail_extra">work (it currently appears after the closing html tag)?</div><div class="gmail_extra"><br></div><div class="gmail_extra">Another thing that concerns me is that whether logging happens</div><div class="gmail_extra">whenever a new result page is loaded or it happens just once for</div><div class="gmail_extra">each search? We certainly don't want to log the same page again</div><div class="gmail_extra">in case user returns back to an already visited page but we do want</div><div class="gmail_extra">to log each page once as that is how we'll be able to record offset</div><div class="gmail_extra">values.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks,</div><div class="gmail_extra">Vivek</div><div><br></div></div></div>