Exemple #1
0
        /*
         *  public IResultSet Search(ICQLQuery query)
         *  {
         *          EnsureConnected();
         *          IntPtr yazQuery = Yaz.ZOOM_query_create();
         *          Yaz.ZOOM_query_cql(yazQuery, query.QueryString);
         *
         *          IntPtr yazResultSet = Yaz.ZOOM_connection_search(_zoomConnection, yazQuery);
         *
         *          int errorCode = Yaz.ZOOM_connection_errcode(_zoomConnection);
         *          if (errorCode != Yaz.ZOOM_ERROR_NONE)
         *          {
         *                  Yaz.ZOOM_resultset_destroy(yazResultSet);
         *          }
         *          Yaz.ZOOM_query_destroy(yazQuery);
         *          yazQuery = IntPtr.Zero;
         *          CheckErrorCodeAndThrow(errorCode);
         *
         *          ResultSet resultSet = new ResultSet(yazResultSet, this);
         *          return resultSet;
         *  }
         *
         *  public IResultSet Search(IPrefixQuery query)
         *  {
         *          EnsureConnected();
         *          IntPtr yazQuery = Yaz.ZOOM_query_create();
         *
         *          Yaz.ZOOM_query_prefix(yazQuery, query.QueryString);
         *
         *          IntPtr yazResultSet = Yaz.ZOOM_connection_search(_zoomConnection, yazQuery);
         *
         *          int errorCode = Yaz.ZOOM_connection_errcode(_zoomConnection);
         *          if (errorCode != Yaz.ZOOM_ERROR_NONE)
         *          {
         *                  Yaz.ZOOM_resultset_destroy(yazResultSet);
         *          }
         *          Yaz.ZOOM_query_destroy(yazQuery);
         *          yazQuery = IntPtr.Zero;
         *          CheckErrorCodeAndThrow(errorCode);
         *
         *          ResultSet resultSet = new ResultSet(yazResultSet, this);
         *          return resultSet;
         *  }
         *
         */
        public IScanSet Scan(IPrefixQuery query)
        {
            EnsureConnected();
            IntPtr yazScanSet = Yaz.ZOOM_connection_scan(_zoomConnection, query.QueryString);

            int errorCode = Yaz.ZOOM_connection_errcode(_zoomConnection);

            if (errorCode != Yaz.ZOOM_ERROR_NONE)
            {
                Yaz.ZOOM_scanset_destroy(yazScanSet);
            }
            CheckErrorCodeAndThrow(errorCode);

            ScanSet scanSet = new ScanSet(yazScanSet, this);

            return(scanSet);
        }