为通过PHP COM的Windows索引搜索设置limit / maxRecords属性 [英] Set a limit / maxRecords property for Windows Indexing Search through PHP COM

查看:67
本文介绍了为通过PHP COM的Windows索引搜索设置limit / maxRecords属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Windows索引搜索和PHP来搜索数千个文件。

I'm using Windows Indexing search together with PHP to search inside thousands of files.

我通过使用 PHP COM 类:

$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
$recordset = new COM("ADODB.Recordset");

$conn - > Open("Provider=Search.CollatorDSO;Extended Properties='Application=Windows';");


$recordset - > Open("SELECT System.ItemName, System.DateModified FROM  SYSTEMINDEX  WHERE DIRECTORY='file:C:/xxxx/' AND CONTAINS('xxxx')", $conn);

$recordset - > MoveFirst();

while (!$recordset - > EOF) {
    echo $recordset - > Fields - > Item("System.ItemName") - > Value."\n";
    $recordset - > MoveNext();
}

现在,我想使用 maxRecords 属性,在Visual Basic中用于处理ADO。

Now I would like to use the maxRecords property as used in Visual Basic to deal with ADO.

//Visual Basic usage of the property
objRecordSet.MaxRecords = 150

我不知道PHP中的COM类是否有任何等效项,并且我在文档中找不到任何内容。

I don't know if there's any equivalent for the COM class in PHP and I couldn't find anything in the documentation.

推荐答案

您尝试过吗?

$recordset = new COM("ADODB.Recordset");
$recordset->MaxRecords = 150;

PHP的COM类通常只是COM的包装(我认为是OLE Automation),并且大多数情况下,如果将属性或函数公开给VBScript,则可以将其直接转换为PHP代码。

PHP's COM class is just a wrapper around COM in general (I think OLE Automation to be specific), and for the most part if a property or function is exposed to VBScript, it can be translated into PHP code directly.

这篇关于为通过PHP COM的Windows索引搜索设置limit / maxRecords属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆