PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Filtering Search By Result Subfolder

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

  • Filtering Search By Result Subfolder

    I have a similar question to this: http://www.wrensoft.com/forum/showthread.php?t=2674

    I believe the difference may lie in quantity. There are hundreds of directories each with hundreds of PDF files. Do categories rely on adding META tags to files?

    I'd like to be able to dynamically filter down to just one of the subdirectories based on who is doing the searching. I'd like to maintain proper paging if possible. I can do the ASP coding but I'm not sure if there's a way to update search.asp to do the filtering before getting down to displaying the results.
    Last edited by jcbeck; Jul-29-2008, 01:37 PM.

  • #2
    Here's what I'm adding to search.asp

    Code:
    ...
    
                [B]REM use cookie, querystring, hidden form field or drop down etc
                REM to provide desired subfolder
                dim mySubDirectory
                mySubDirectory = "/client-a/"[/B]
    
    ...
    
                        ' AND search, filter out non-matching results
                        IsFiltered = True
                    end if
                end if
                
                [B]REM jcb 7/28/08
                REM get the URL and filter on directory
                if len(mysubdir) > 0 and (IsFiltered = False) Then
                    pgdata = GetPageData(zoomit)
                    url = pgdata(PAGEDATA_URL)
    
                    if instr(url,mysubdir) = 0 then
                        IsFiltered = True
                    end if
                end if [/B]
    
                if (IsFiltered = False) then
                    ' copy if not filtered out
                    redim preserve output(5, oline)
    
    ...
    Last edited by jcbeck; Jul-28-2008, 09:19 PM.

    Comment


    • #3
      Originally posted by jcbeck View Post
      Do categories rely on adding META tags to files?
      No, categories can be specified based on text that appears within the URL (substring match) either in the folder name or filename, OR meta tags within the files.

      See the "Categories" chapter in the Users Guide for more information.
      --Ray
      Wrensoft Web Software
      Sydney, Australia
      Zoom Search Engine

      Comment


      • #4
        I guess the problem I had with categories was just that they'd need to be created for every new subfolder I added, which is in the hundreds. And it would require console administration to add those categories. The code I added works, but perhaps it has affected the "matches" count. It seemed to me in the code that the result count was only factored in after filtering, so my code wouldn't break it, but I guess I'm wrong about that.
        Last edited by jcbeck; Jul-30-2008, 07:42 PM.

        Comment


        • #5
          Your code change should not affect the "matches" count I think, but that's just going by a brief look at your code.

          Note that we can not provide support for any custom code changes to the default script, and you will need to port your changes over to later revisions of the script should there be bug fixes etc.
          --Ray
          Wrensoft Web Software
          Sydney, Australia
          Zoom Search Engine

          Comment


          • #6
            Thanks - reordering my code did fix counting. I'm now looking into CGI options anyway...

            Comment

            Working...
            X