Author Topic: Hits > 1 from CMOD Client. but not from the ODWEK API  (Read 1497 times)

psandeep1389

  • Newbie
  • *
  • Posts: 4
    • View Profile
Hits > 1 from CMOD Client. but not from the ODWEK API
« on: December 19, 2019, 11:34:26 AM »
ODServer odServer = new ODServer (new ODConfig (
            /*AfpViewer*/           ODConstant.PLUGIN,
            /*LineViewer*/          ODConstant.APPLET,
            /*MetaViewer default*/  null,
            /*MaxHits*/             500,
            /*AppletDir*/           "/applets",
            /*Language*/            "ENU",
            /*TempDir*/             "",
            /*TraceDir*/            "",
            /*TraceLevel*/          4));
      try {
         odServer.setConnectType (ODConstant.CONNECT_TYPE_TCPIP);
         odServer.setServerName (serverName); // Name or IP address localhost
         odServer.setPort (port); //1445 or 0
         odServer.setUserId (userId); //
         odServer.setPassword (pwd);// odServer.initialize ("CMODOperations");
         odServer.logon();
         //logger.info ("OnDemand server " +odServer.getServerName () + " is alive and the folder to be searched is "+odServer.getFolderDescription(folderToSearch));
         logger.info ("OnDemand server " +odServer.getServerName () + " is alive and the folder to be searched is "+folderToSearch);
         logger.info("Folder "+odServer.getFolderDescription(folderToSearch)); //
      
         ODFolder odFolder = odServer.openFolder(folderToSearch); ////
         odFolder.setApplGroupForSearchWithSQL("Test");
         
         logger.info("Odfolder "+odFolder.getName()+" Param :"+odFolder.isOrSearchCriteria());
         //Option 1 Getting and setting the criteria and value
         
         /*
          *
          *
          * ODCriteria odCrit = odFolder.getCriteria(criteriaName); // INVOICE
          *
          * odCrit.setOperator(ODConstant.OPEqual);
          *
          * logger.info(criteriaName+" : Invoice Number Length : "+invoiceNumber.length()
          * +" :: "+odCrit.isQueryable());
          *
          * odCrit.setSearchValue(invoiceNumber); //
* Vector<ODHit> hits = odFolder.search();
          */
         
         logger.info( "HITS ARE "+odFolder.getHits());
         //option two with SQL query
         Vector hits = odFolder.search("where doc_name like '%' ");
         logger.info("Hits are "+hits.size() + " IS empty "+hits.isEmpty() +" : Hit  ");
Hits are 0 and Is Empty true.

spond

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: Hits > 1 from CMOD Client. but not from the ODWEK API
« Reply #1 on: December 20, 2019, 07:59:37 AM »
Without understanding your folder definition, I'd suggest first turning on query logging for the Application Group(s) in the folder. Then perform the search from the Windows client where you get 1 hit. Perform your query using ODWEK, and in the System Log Msg 65, verify that the query from AGID from the Windows client search matches the AGID from the ODWEK search.