Menu

GDS and Java API Newbie Help

Help
2006-06-22
2013-04-03
  • Srikant Jakilinki

    Dear All,

    Thank you all very much for the Java API for GDS and the discussion. I have downloaded it and am about to use it for doing some small experiments on keyword analysis on the desktop. However, I am not much of a programmer and was wondering if any of you could help me learn the basics ideally by sample code that I can per-use before diving in.

    Mostly I want to execute a search query such as “filetype:doc” to get all MS Word files, get all their contents (from the cache ideally) and then apply keyword extraction algorithms on the collected content. Could you please guide me of how best I can do this?
    There is an example of how to execute JGDQuery which ends with -
    Results results = q.execute(); // Execute query
    I really want to know how to parse results one by one and collect the cached content from Results. Can you please guide me and give examples of how to do such a thing?

    Any help and advise would be much appreciated. If I get anywhere with this, I will release the code and results myself to the group.

    Kind Regards,
    Srikant
    (sriks _a_ dcs.gla.ac.uk for direct email)

    P.S: On an unrelated note, do you know how to modified files for a particular day using GDS directly? Like say, I want to get modified files on June 21st 2006 etc.

     
    • Maso Gato

      Maso Gato - 2006-09-20

      System.out.println("XML:");
      q.writeLastResultInXML( System.out );

      System.out.println();

      System.out.println( "Results:"  + r.getCount());
      System.out.println();

      List l = r.getResult();
      for (Iterator i = l.iterator(); i.hasNext();) {
          ResultsType.ResultType element = (ResultsType.ResultType) i.next();
          System.out.println("-------------------");
          System.out.print( element.getTitle() );
          System.out.println( ": " );
          System.out.println( element.getUrl() );
          System.out.println( element.getSnippet() );

          System.out.println( Util.filetimeToDate( element.getTime().longValue() ) );
         
      }

      Regards,

       

Log in to post a comment.

MongoDB Logo MongoDB