Popular Posts
Multiple line of text limit With Sharepoint Designer, edit the page of list view. Add xsl template as below to override original template. Source template could be foun... android.intent.action.SCREEN_ON & android.intent.action.SCREEN_OFF First, I've tried create a receiver to receive screen on/off and register receiver on AndroidManifest.xml like below, but unfortunately ... Memo: Debounce Task To prevent multi-execution from caller in short time, use debounce for single execution. var debounce = function (func, threshold, execAsap...
Blog Archive
Stats
Query index data
1. Start window service Indexing Service
2. Create a new category and start indexing.
class Program
{
    static void Main(string[] args)
    {
        // reference : http://msdn.microsoft.com/en-us/library/ms690516
        string strCatalog = "TestIndexing";
        string strKeyword = "readme";  // search keyword
        string strQuery = string.Format(
            @"SELECT path, FileName, size, write, attrib FROM SCOPE() WHERE FREETEXT('{0}')",
            //@"SELECT * FROM FILEINFO WHERE FREETEXT('{0}')",
            strKeyword
        );
 
        string connstring = "Provider=MSIDXS.1;Integrated Security .='';Data Source=" + strCatalog;
 
        DataSet set = null;
        try
        {
            using (OleDbDataAdapter adapter = new OleDbDataAdapter(strQuery, connstring))
            {
                adapter.Fill(set = new DataSet());
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
            return;
        }
 
        foreach (DataRow row in set.Tables[0].Rows)
        {
            Console.WriteLine("{0} |{1} @{2}", row["FileName"], row["size"], row["write"]);
        }
        Console.Read();
    }
}