PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

How does sort by date work?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How does sort by date work?

    I wanted to know which date zoom uses, is it the last modified date?

    Also if I had a forum, how would I update these dates so that my forum could be searched with them. At the moment, the search script does not recognise the dates for the forum.

    thanks

  • #2
    HTTP Last Modified date

    Yes, Zoom uses the HTTP Last-Modified date.

    For dynamically generated pages (such as a forum), you can specify the HTTP Last-Modified date with a bit of scripting.

    Here are some examples which set a page's last-modified date to 1st of September 1997.

    in PHP:
    header("Last-Modified: Mon, 01 Sep 1997 01:03:33 GMT");

    in ASP:
    Response.AddHeader "Last-modified","Mon, 01 Sep 1997 01:03:33 GMT"

    Remember that because it is part of the HTTP header, this must be executed before any HTML output. See the documentation for the header() and AddHeader() functions respectively for more information.

    In Version 4.1, we will also add a feature to extract the date from a ZOOMDATE meta tag within a page.
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      Originally posted by Ray View Post
      In Version 4.1, we will also add a feature to extract the date from a ZOOMDATE meta tag within a page.
      Did this ever get added? I'm working on trying to be able to sort a dynamic site by date, also, and would love to know if it did...

      ETA: I didn't realize this was in the v4 forum (I searched to find it) - I'm actually using the very latest version, and we have a bunch of pages put together with ASP; the content itself is all in the database. The weird thing is...all the results pages show up with *no* date, not even the indexing date (I have "date" checked, and it shows up when there's a .doc file in the results, but not for any of the ASP results). If someone could explain why that is, I'd be grateful, too. Our URLs are all of the format x/x/default.asp?a=x,b=y (and the x and y determine the content), could that be why?

      -Sandy
      Last edited by slcronin; Dec-20-2007, 10:55 PM.

      Comment


      • #4
        HTML Last-Modified meta tag

        Support for the HTML Last-Modified meta tag was added in V4.1 (June 2005). So you can change the date without modifying the HTTP header.

        See section 7.8, "Specifying a last-modified date for your web pages", of the Zoom Users Guide for details.

        For example,
        <meta http-equiv="Last-Modified" content="Sat, 07 Apr 2001 00:58:08 GMT">

        You need to get the Syntax exactly correct however.


        For the issue with your ASP pages, are you returning a HTTP Last-Modified date, or a HTML meta tag date?

        Comment


        • #5
          OK, now I'm *really* confused. Sorry! I promise I've read the section in the user guide.

          First, does that http-equiv metatag need to be in the <head>?

          I think I'm partly confused because of the reference to a "zoomdate" metatag, which doesn't actually appear to exist, right?

          And, as for our ASP pages, I'm not sure. All I know for sure is that NO date shows up for those pages on the zoom results page, even though it's checked in the configuration and shows up for other file types. Is that by design? If a file has no date (as far as zoom can tell), does it leave it blank? I was confused because I thought I saw reference (but again, that could have been version 4), to it plugging in the indexed time instead in that case.

          If I'm understanding correctly, for our pages that are, for instance, news articles, I would need to use the datetime field saved with the record for the news article being shown on the page, and munge it until I get it to conform to the metatag date/time format, and plug it into a http-equiv metatag when the page is displayed? Does it sound like I have the general gist?

          Thanks,

          -Sandy

          Comment


          • #6
            ...does that http-equiv metatag need to be in the <head>?
            Yes, all HTML meta tags go in the <head> section of your HTML file.

            ...reference to a "zoomdate" metatag, which doesn't actually appear to exist, right?
            Correct. It doesn't exist. You need to use the Last-Modified tag, as described in the Users Guide.

            If there is no date in the HTML nor in the HTTP header, then it should pick up the index date. But you might find you are returning something invalid in the HTTP header (like time = 0). Which is why you should check this if the results are not what you expect.

            ...plug it into a http-equiv metatag when the page is displayed?
            Yes, you need to include the date into the HTML Last-Modified meta tag or the HTTP header, as descibed above. If all your document dates are in a database, then yes, you need to get the date from a database first.

            Comment


            • #7
              Thank you for the help! I did a quick proof of concept and got dates to show up on some of my ASP pages; turns out converting the date to the right format for that metatag is pretty ugly in JS, but it's doable.

              I'm not sure what's up with our pages that don't have dates; I don't know enough about http headers to know what we're sending, but when I add the metatag, it's definitely using that date, which is good. I'm glad it's not using indexed date, actually, because that would put the articles with real dates at the end of the results, behind everything without real dates (since we index every day); this way, they're at the top when sorting by date.

              Thanks again!

              -Sandy

              Comment

              Working...
              X