Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 Search Question
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

GauravBhabu
Advanced Member

4288 Posts

Posted - 01 October 2002 :  20:13:31  Show Profile
continued from
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=36153

quote:
Originally posted by ruirib

Ok, I removed the second one, since the first is the one I think works as expected.

Gaurav, I think using T_LAST_POST can be misleading. Imagine a topic 4 months old, that somewhere in its contents has the keyword being searched for. Now imagine that after these four months you have a reply to it, where the keyword is not used. If you search for posts with the keyword, say for the last seven days, a day or two after this last reply has been made, the topic will appear in the result set even if the reply that complies with the time criteria does not have the keyword being searched for. So, IMO, this would lead to the topic erroneously being included in the result set.
Using T_DATE or R_DATE you are indeed ensuring that you have a post that contains the keyword and complies with the date requirements.



ruirib, I do not think the topic will be included because the keyword occurs in the post 4 months ago and we are searching for keyword in the posts which are made within last 7 days.

I have a question?

Let us take this example.

A topic started 7 days ago. There are 300 replies to it.
Last reply to the topic was posted 5 days ago.
I read the topic 2 days ago.
One of the replies, which contains the keyword, was edited the day I read it and the keyword was written in the post during the edit.

Will it return the topic if I use the search by selecting 2 days ago in the drop down for date?

Edited by - GauravBhabu on 01 October 2002 20:20:55

work mule
Senior Member

USA
1358 Posts

Posted - 01 October 2002 :  20:51:01  Show Profile
I have to agree with ruirib on this one (I think).

The first criteria is topics/replies which have been posted within x amount of time. I wouldn't want to include the topic message itself unless T_DATE (it's date or posting) was within that time frame. If one of the replies to that topic had a posting date that me the criteria, then we'll use the reply within our subset of records. If the reply matches the keyword, then the entire thread is included in the results.

Hmm...none of these arguments really make sense after you read them.

I guess I'm saying that there's no need to include the topic message itself unless it meets the criteria of date and keyword. If replies have been made which match the criteria, the whole thread is marked as matching the search criteria.
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 01 October 2002 :  21:30:31  Show Profile  Send ruirib a Yahoo! Message
Gaurav, that situation I talked about it really happens. I've tested it before I posted. By looking at the SQL you will find that there is no criteria added to restrict the replies to the date criteria set for the search, if you use T_LAST_POST. All replies will be "considered" for keyword search, if the topic they belong to has a T_LAST_POST that complies with the date criteria, regardless of the replies date.

Now considering your question, I guess you know the answer to that. IMO, in coherence with what I posted before, to get the correct records, you will need to add a comparison including R_LAST_EDIT, if you want to consider the date for record editions as criteria to include the topics in the recorset returned by the search.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 01 October 2002 :  22:20:52  Show Profile
ruirib, I agree that there is no criteria in the search sql to restrict the replies which are returned depending on the date. To restrict the replies which are displayed according to the date, it is required that the date be passed on to the topic.asp and in the sql for replies the date criteria be used to restrict the replies which are displayed. I have not tested but i think it will work.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 01 October 2002 :  22:40:18  Show Profile
This is what I tried to restrict the replies.

Search.asp
Around Line 230
SearchLink = "&SearchTerms=" & chkString(strKeyWords,"search")
if cLng(Request.Form("SearchDate")) <> 0 then	
	dt = cLng(Request.Form("SearchDate"))
SearchLink = SearchLink & "&SearchDate=" & DateToStr(dateadd("d", -dt, strForumTimeAdjust))
end if



Around Line 300
strSql3 = strSql3 & " AND ((T.T_DATE > '" & DateToStr(dateadd("d", -dt, strForumTimeAdjust)) & "')"
strSql3 = strSql3 & " OR (R.R_DATE > '" & DateToStr(dateadd("d", -dt, strForumTimeAdjust)) & "')"
strSql3 = strSql3 & " OR (R.R_LAST_EDIT > '" & DateToStr(dateadd("d", -dt, strForumTimeAdjust)) & "'))"



topic.asp

if Request.QueryString("SearchDate") <> "" then 
   strSql3 = strSql3 & "AND (R.R_DATE > '" & Request.QueryString("SearchDate") & "') "
end if
   strSql4 = "ORDER BY R.R_DATE ASC"


Edited by - GauravBhabu on 01 October 2002 22:57:32
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 02 October 2002 :  09:51:17  Show Profile  Send ruirib a Yahoo! Message
Gaurav,

I can have a look at this later on. Will let ya know what I think then.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 02 October 2002 :  10:42:32  Show Profile
Oh it works as i expected it to work.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.59 seconds. Powered By: Snitz Forums 2000 Version 3.4.07