![]() ![]() Search is then run again in full text mode, where the contents of the documents are searched. The file name matches are placed at the top of the results list. The CONTAINS search is first run on file names only, where partial string matching will work (e.g. You may also include one file extension (e.g. are taken care of by the script, so that query entry is user-friendly. Boolean operator capitalization and missing ANDs, etc. Further instructions and comments are given in the query input box that pops up when you run the script.ĬONTAINS takes more complex queries, such as, ,, , and. You can also specify a single extension to restrict the search by filetype, as in. Then when I click on this item I get the option to do a FREETEXT or CONTAINS search.įREETEXT takes a simple query that is only composed of words that should appear in the document or file name, example queries could be, , or. I keep these three scripts in my \Scripts directory and use them by creating a catalog item that does ::load WinSearch. ProcessContentsQuery.xys: loaded by the CONTAINS script to convert the query in to SQL form for contents search.įour permanent variables are created to allow these scripts to share information: $perm_name_query and $perm_contents_query are filled with the SQL-like query, while $perm_freetext_query and $perm_contains_query hold the last user-specified queries so they don't need to be input again on the next call to the script.ProcessNameQuery.xys: loaded by the CONTAINS script to convert the user-supplied query into SQL form for name search.WinSearch.xys: contains two scripts: FREETEXT and CONTAINS (see below for what they do).The attached file WinSearch.zip file contains three script files: Create a paper folder called "SearchResults" containing these results, and display its contents.Call cscript.exe from the command prompt to run the VBScript, and return the list of found files to XYPlorer. ![]() Create a WinSearch.vbs file containing the VBScript (this file is created inside XYPlorer's scripts folder).Change it into the form required by the SQL syntax.So I wrote scripts that do the following: You'll have to check out the links I've provided above if you want to dig into the details of this SQL search syntax. What I could get to work are the following: i) partial string matching using LIKE in file name searches ii) simple fulltext searching using FREETEXT and iii) fulltext searching with boolean operators and prefix matching using CONTAINS.Some of those potentially useful features-such as automatically matching inflected word forms using FORMSOF-I could not get to work right.The SQL query syntax is unwieldy for a human to enter, but it contains a variety of potentially useful search features (start here).Such a script can be run from a command prompt using cscript.exe, and the resulting list of file paths can be directed into a text file. ![]() It is possible to write a simple VBScript to query Windows Search using "Windows Search SQL" (See the "ADO and VBScript" section here).For those that like the speed and convenience of the indexed search in Windows, it might be useful. ![]() Since I spent an inordinate length of time getting it to work, I thought I might as well share my code. I am not a big forum guy but I just got hooked on writing a script to do the following: accept a user's query, feed it to Windows Search, and display the found files in a paper folder in XYPlorer. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |