PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

XML/RSS output Not Returning Results

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

  • XML/RSS output Not Returning Results

    I'm just learning to use the product and having a trouble outputting to XML. I have followed the examples for using vb.net to return an html result set. I have taken that example and ported it to c# but I can't get the results to return in XML format. I indexed with output to cgi/windows. Here is the code:
    string parameters = string.Empty;
    parameters = "&zoom_query=" + this.SearchTextbox.Text;
    parameters += "&zoom_page=1";
    parameters += "&zoom_per_page=10";
    parameters += "&zoom_and=0";
    parameters += "&zoom_xml=1";
    string cgi_path = AppDomain.CurrentDomain.BaseDirectory + "search.cgi";
    ProcessStartInfo psi = new ProcessStartInfo(cgi_path);
    psi.EnvironmentVariables["REQUEST_METHOD"] = "GET";
    psi.EnvironmentVariables["QUERY_STRING"] = parameters;
    psi.RedirectStandardInput = false;
    psi.RedirectStandardOutput = true;
    psi.UseShellExecute = false;
    psi.CreateNoWindow = true;
    Process proc = Process.Start(psi);
    proc.StandardOutput.ReadLine();
    string zoom_results = proc.StandardOutput.ReadToEnd();
    proc.WaitForExit();

    string results = zoom_results;


    Results

    <?xml version="1.0" encoding="windows-1252"?>
    <!--Zoom Search Engine Version 5.1 (1009)-->
    <rss version="2.0" xmlnspensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"> xmlns:zoom="http://www.wrensoft.com/zoom/response/5.0/schema/">
    <channel>
    <title></title>
    <description></description>
    <link></link>
    </channel>
    </rss>

  • #2
    I am not sure why you needed to port it to C#, since the original example provided on our ASP.NET page is already provided in C#?
    http://www.wrensoft.com/zoom/support/aspdotnet.html

    There are two examples on that page, the first one is C# and the second is VB.NET. I would recommend trying our provided code instead. If there is a problem using our C# example, let us know.

    I am also not sure what the problem is with the output results. You said, "I can't get the results to return in XML format" but then the results you pasted are in XML format. Is the problem here that there is zero results returned? In which case, the problem may be more related to what files have been indexed, and the search query submitted. Please clarify if this is not the case.
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      Did not see the C# example. Sorry. Anyway, I copied the code but still no results. I checked the zoom_dictionary.zdat file and it has data. The word I'm searching for is journal which is in the file. I'm guessing the number next to it is the number of occurances. I verified that it indexed the only htm file I have that has the word "journal" and copied the updated index files to the correct directory. Not sure what I'm doing wrong. My constructed query string is:

      &zoom_query=journal&zoom_page=1&zoom_per_page=10&z oom_and=0&zoom_xml=1.

      Here is the log:

      19:27:56 - Start indexing (offline mode) at Mon Nov 19 19:27:56 2007
      19:27:56 - Maximum number of words: 15000
      19:27:56 - Maximum number of files: 50
      19:27:56 - Will scan files with extensions
      19:27:56 - .htm
      19:27:56 - .html
      19:27:56 - .txt
      19:27:56 - .php
      19:27:56 - .asp
      19:27:56 - .cgi
      19:27:56 - .aspx
      19:27:56 - .pl
      19:27:56 - .php3
      19:27:56 - Search root directory: C:\Documents and Settings\xxx\My Documents\My Projects\HelpPrototype\HelpPrototype\HelpContent
      19:27:56 - Web site URL: ./
      19:27:56 - Estimated RAM required during index process: 4396 KB
      19:27:56 - [INDEXED] Indexing C:\Documents and Settings\xxx\My Documents\My Projects\HelpPrototype\HelpPrototype\HelpContent\A P\HTMLPage1.htm
      19:27:56 - [FILEIO] Writing index data for CGI/Win32 search... (Please wait)
      19:27:56 - [FILEIO] Created pagedata data file (zoom_pagedata.zdat)
      19:27:56 - [FILEIO] Created pagetext data file (zoom_pagetext.zdat)
      19:27:56 - [FILEIO] Created pageinfo data file (zoom_pageinfo.zdat)
      19:27:56 - [FILEIO] Created dictionary data file (zoom_dictionary.zdat)
      19:27:56 - [FILEIO] Created wordmap data file (zoom_wordmap.zdat)
      19:27:56 - [FILEIO] Created script settings file (settings.zdat)
      19:27:56 - Indexing completed at Mon Nov 19 19:27:56 2007
      19:27:56 - INDEX SUMMARY
      19:27:56 - Files indexed: 1
      19:27:56 - Files skipped: 23
      19:27:56 - Files filtered: 0
      19:27:56 - Files downloaded: 0
      19:27:56 - Unique words found: 198
      19:27:56 - Total words found: 199
      19:27:56 - Avg. unique words per page: 198.00
      19:27:56 - Avg. words per page: 199
      19:27:56 - Start index time: 19:27:56 (2007/11/19)
      19:27:56 - Elapsed index time: 00:00:00
      19:27:56 - Errors: 0
      19:27:56 - Total bytes scanned/downloaded: 164
      19:27:56 - File extensions:
      19:27:56 - .htm indexed: 1
      19:27:56 - .html indexed: 0
      19:27:56 - .txt indexed: 0
      19:27:56 - .php indexed: 0
      19:27:56 - .asp indexed: 0
      19:27:56 - .cgi indexed: 0
      19:27:56 - .aspx indexed: 0
      19:27:56 - .pl indexed: 0
      19:27:56 - .php3 indexed: 0
      19:27:56 - No extensions indexed: 0
      19:27:56 - Cleaning up memory used for index data... please wait.
      19:27:56 - Finished cleaning up memory.

      Comment


      • #4
        Originally posted by Pug View Post
        Did not see the C# example. Sorry. Anyway, I copied the code but still no results. I checked the zoom_dictionary.zdat file and it has data. The word I'm searching for is journal which is in the file. I'm guessing the number next to it is the number of occurances.
        No, the number next to the word in the zoom_dictionary.zdat file is not the number of occurances.

        I would recommend temporarily disabling the XML output, and not using the ASP.NET wrapper that you are attempting at the moment. You should get your CGI search working as you want first, and it would then be much easier for you to determine whether you have indexed the files correctly, or configured Zoom as needed. Once you are sure the search function is working as you want, then switch over to XML output and using your .NET wrapper.

        If your web page is online, provide us with a URL, so we can take a look. Similarly if you can make the search function online. Since we can't see the HTML page in question, we can not tell you why the word was not found on that page. If you can't put the file somewhere accessible online, you can e-mail it to us.

        You also mentioned that you are copying the "updated index files" manually from the output folder. You may want to make sure you copy ALL the files listed at the end of indexing (in a window titled "Required files") and make sure it overwrites any existing files from previous indexing attempts.

        Better yet, would be to point your output directory to the folder that you want the search files to end up in, so there is no risk of copying the wrong files. If you need to upload the files to a server, then you can use the built-in FTP upload functionality.
        --Ray
        Wrensoft Web Software
        Sydney, Australia
        Zoom Search Engine

        Comment


        • #5
          I figured it out. I had & at the beginning of my parameter string. I removed that and it works now. Sorry about that. thanks for the quick responses. See below:

          Was
          string parameters = string.Empty;
          parameters = "&zoom_query=" + this.SearchTextbox.Text;
          parameters += "&zoom_page=1";
          parameters += "&zoom_per_page=10";
          parameters += "&zoom_and=0";
          parameters += "&zoom_xml=1";

          now

          string parameters = string.Empty;
          parameters = "zoom_query=" + this.SearchTextbox.Text;
          parameters += "&zoom_page=1";
          parameters += "&zoom_per_page=10";
          parameters += "&zoom_and=0";
          parameters += "&zoom_xml=1";

          Comment

          Working...
          X