Jump to content

New Spotlight clone


Recommended Posts

This posting is provided "AS IS" with no warranties, and confers no rights.

blah blah blah

You have two options there...

You can use the Query.SearchDesktop class and the ExecuteQuery method, or you can use the wrapper class "SampleWrapper.QueryBuilder" by including QueryBuilder.cs in your project. It shouldn't matter that it's CSharp and you're using VB, that's part of the beauty of .NET :)

The QueryBuilder class should give you IntelliSense support and make working with the API a little easier.

Otherwise, to use the COM interface, try this:

Open VS 2003 and create a new VB.NET "Windows Forms" project. Add a reference to WDSQuery.dll.

Drop a DataGrid control from the toolbox onto the form, and size it reasonably. Leave the name as "DataGrid1" for now.

Copy and paste this code into the vb file:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim mSearchClass As New Microsoft.Windows.DesktopSearch.Query.SearchDesktopClass

Dim resultSet As Microsoft.Windows.DesktopSearch.Query._Recordset

resultSet = mSearchClass.ExecuteQuery("test", "DocTitle,DocAuthor,Url", "DocTitle", Nothing)

Dim DataSet1 As New System.Data.DataSet

Dim DataTable1 As New System.Data.DataTable

DataSet1.Tables.Add(DataTable1)

Dim DataAdapter1 As New System.Data.OleDb.OleDbDataAdapter

DataAdapter1.Fill(DataTable1, resultSet)

DataGrid1.DataSource = DataSet1

DataGrid1.DataMember = "Table1"

End Sub

Build and run. Your datagrid should be filled with results for the query "test" - you can of course change that to something more pertinent to your index.

VB isn't really my thing, but that works on my system and should give you a basic idea of how to use the COM interfaces.

Watch my blog, I'll do a post for VB developers today or tomorrow. I don't have internet access at my new place til tomorrow morning... that's why I haven't been able to post much :)

http://geekswithblogs.net/bpaddock

Link to comment
  • Replies 598
  • Created
  • Last Reply

Top Posters In This Topic

Also thought I'd mentioned that one nice thing about the above solution (using OleDbDataAdapter to convert the ADO recordset into a .NET DataSet object) is that you can do any kind of .NET Databinding that you want on it. In the example I gave, I bound the DataGrid1 control to the result table. But you can also bind a listBox to one column of results (by setting the DataSource and DataMember or DisplayMember properties) , or pretty much anything else that you could do with a live DB connection using ADO .NET.

Unfortunately, with our current implementation you cannot ask for a limited number of results - which is one way to improve perf significantly when dealing with a large list of records. We hope to fix that in a future release. Also, calling the Fill() method will dump all the results from the ADO recordset into the DataTable. I haven't had a chance to do any testing yet, but you might experience better performance if you only fill a certain number of rows to the table, since you won't have to touch n number of records. What you can or would want to do with that is entirely dependent on your app. In some cases (like word wheeling) it's easy to get by with just the top 10 results. In other cases you'll need the entire set anyway.

Link to comment
  • 2 weeks later...

i love this-i have a few suggestions thou

is there any way to make it more like the windows search panel in terms of what u can search for(I.E. like system files, folders and things like that) also, maybe increase the number of results per group. FInally, I have to say that it might help ppl if you tell them what the dimensions of the chnage image should be, as i messed it up and had to reinstall it

Other than that this is a great clone and works very well

Link to comment
  • 2 weeks later...

Read the instructions. You need Google Desktop Search. Install that first. Then if your computer is all patched up properly, like it should be, then Spotlite will install no porblem. If not, run Windows Update. After Spotlite installs, you will be prompted to do a google desktop search. Follow the VERY SIMPLE INSTRUCTIONS on how to get Spotlite to work. Simple.

Link to comment
Read the instructions. You need Google Desktop Search. Install that first. Then if your computer is all patched up properly, like it should be, then Spotlite will install no porblem. If not, run Windows Update. After Spotlite installs, you will be prompted to do a google desktop search. Follow the VERY SIMPLE INSTRUCTIONS on how to get Spotlite to work. Simple.

But this Google desktop search is too slow and too long, can someone better explain me what does Google Desktop Search do exactly?

Link to comment

Hopefully with working sort/group/when/where functions? :-D

Also, more of a feature request. How about an option to (perhaps by right-click menu, since it may not actually be in the real Spotlight) open the containing folder, as provided by GDS' web interface. I more often use GDS (and would use Spotlight) to locate and copy/move/edit files than to open them.

It would also be absolutely gorgeous if the expand/close buttons worked :-D.

I love your Spotlight and use it a lot, but as with any Beta app, it can use some improvements.

Link to comment

TomLapp,

I think, considering the value of the reward we are all so anxiously awaiting, you are allowed to take all the time you need. Except for the fact that it sometimes jumps down from it's corner, I think build #18 is awesome and I'm perfectly fine using it forever. But if you've got something better up your sleeve... well, then, the least we can do is patiently wait.

Thanks again!

Link to comment

I have a problem with the build #18 installer..

after a few seconds the installer stops with the following message:

"The configuration data for this product is corrupt. Contact your support personnel"

I don't know what to do..

I've already searched through my registry and deleted everything with Spotlight in it..

Got an idea how to solve this problem?

Sorry for my bad English :)

Link to comment

Just updated Google Desktop to Beta 2 because now it can index external HDs, which is where most of my stuff is stored anyway - YAY!

However, I don't know if Google's own search string has changed, but your spotlight app (the best available at the moment IMHO), doesn't find ANY of my files though Google Desktop Search itself does.

In your "setup" section, it says that the search string looks something like: http://127.0.0.1:4664/search&s=d2wQ2iRxPmd...L03qFxykXCrM?q=

followed by the criteria etc.

But mine looks like: http://localhost:4664/search?q= (the full result being: http://localhost:4664/search?q=xxxxx&flags...LDFn_rv5TvnhdOA where xxxxx is what i search for) and this doesn't seem to work at all

When I load the Google Desktop website, the URL is: http://localhost:4664/&s=onwKiXYnykLd1_kzd9xa1beLoSA&q=

I tried using this as my search string too, but it doesn't work as well. Am I doing something wrong, or has Google itself changed its search string parameters?

I know you're busy but I think your application is fantastic and I'd really love to be able to use it! Thanks.

EDIT: Nevermind ... Fortunately I saved my search string from before I updated to Beta 2 and it seems to still work. But the question remains - why is my search string different as it appears in the browser?

Link to comment
  • 2 weeks later...

Quickly going back to the idea of Spotlight opening with the Spotlight button on the taskbar. I think I have a solution for OB users who want to use this. All that needs to change in the code of the app is the hotkey which activates the search bar. If it can be changed to any single key stroke, then small VB script can be written emulate a keystroke when opened. This .vbs could then be shortcutted to the spotlight button on the OB-bar. So to the computer, clicking the spotlight button is like activating the hotkey to show the searchbar... wah-la!

btw, Tom, this app is superb :D I'm gonna download the newest nightly build when i get back from work...

Link to comment

Yeah I got the same problem, does not display any results

I tried an old version of goggle desktop search and still get the same, ie no results returned

but works fine when i run from internet explorer /google/desktop search....

tried changing 127.0.0.1 to localhost and makes no difference! (not that i thought it would - but you never know)

anyone out there got any ideas

could something else be blocking it, ie norton internet security or anti-virus?

i tried getchoo (another spotlight light clone - but not as nice ui) and it works, so that the f*** am I doing wrong

please help fellow aquaians.

thank you.

Link to comment

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...