Search foe Asp code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If I create 2 asp files one.asp and two.asp in a new directory
Enter the text 'string' into the file one.asp
Enter the text '<% string %>' into the file two.asp

Open the search from the start menu
Select all files and folders
Type 'string' in the 'A word or phrase in the file' box
Change the 'look in' to the directory that contains the 2 asp files

Click the search button
Only the one.asp file is found in the search

This will return both files in NT, 2000 and all previous versions of Windows

XP doesn't seem to be checking anything in the <% brackets in asp files. These aren't comments and shouldn't be ignored as this can be asp code or javascript code

This is not due to the known problems with search where certain files are not searched and the search breaks up the text of the file into groups of words
This seems to be due the the comments not being searched in certain file types but as you know these aren't comments.
 
It only searches, as it should, text a user can read. Search in XP searches CONTENT.

"A filter performs a full-text search and can also determine properties for a file. A full-text search extracts only the text information from a file, without formatting or graphics information, so that the text can be indexed."

This technology comes from IIS so read up on Index Server.
 
It only searches, as it should, text a user can read. Search in XP searches CONTENT

Is asp \ javascript code not content in a asp file

I am looking for code in a asp file. I don't see why the code should be considered none content in a file that should only really contain code in the <% brackets
In an html file this would be a fair effect as you might want to ignore the formatting and grahics
In code you should not need to ignore these things as these are part and parcel of the code
If you have 200 asp files all of which use include files then it is perferable to be able to find out which files call which files

"A filter performs a full-text search and can also determine properties for a file. A full-text search extracts only the text information from a file, without formatting or graphics information, so that the text can be indexed.

So are you saying search should have an option to switch this on or off then

This would imply by switching off the indexing that the full text of a file is searched but it isn't

Is there some way to call the search dll from 2000 maybe in XP ? This would solve the problem
 
There were changes made in SP1, re searching all files rather than skipping files marked as binary files (though it defaults to skipping binary like dll etc).

As you're an ASP programmer you know more about the IIS search engine than us non IIS people. The IIS engine handles all search in XP (regardless if indexing is off or on). But the docs indicate that you can use any filter for any file type.

ASPs use the HTML filter as specified HKEY_CLASSES_ROOT\.asp\PersistentHandler (will be set to {eec97550-47a9-11cf-b952-00aa0051fe20} which says it's HTML filter at HKCR\CLSID\{eec97550-47a9-11cf-b952-00aa0051fe20}). If you use the plain text filter it will parse the file as unicode if it's first two bytes says I'm a unicode file or as ANSI if there is no unicode headers (unicode text files have a two byte binary header specifing the encoding). Therefore change the filter to {5e941d80-bf96-11cd-b579-08002b30bfeb} (text).

These are the filters
MIME Filter Multipurpose Internet Mail Extensions (MIME) (OE files) mimefilt.dll
HTML Filter HTML 3.0 or earlier nlhtml.dll
Microsoft Office Document Filter Microsoft Word, Excel, PowerPoint® offfilt.dll
Default or Plain Text Filter Plain text files - Default Filter query.dll
Binary or Null Filter Binary files - Null Filter (doesn't filter content only file properties) query.dll


Other manufacturers are supposed to supply their own (EG MS should have provided a filter for ASP with IIS, Adobe for Acrobat files, etc).

This engine is far more powerful. It allows google type results, abstracts, and has a full query language (though not on the content).
 
Dave said:
If I create 2 asp files one.asp and two.asp in a new directory.
Enter the text 'string' into the file one.asp.
Enter the text '<% string %>' into the file two.asp.

Open the search from the start menu.
Select all files and folders.
Type 'string' in the 'A word or phrase in the file' box.
Change the 'look in' to the directory that contains the 2 asp files.

Click the search button.
Only the one.asp file is found in the search.

This will return both files in NT, 2000 and all previous versions of Windows.
Hi

See if the free search utility Agent Ransack works better for you,
I use it instead of the builtin search (especially on WinXP, where
Microsoft has almost destroyed the builtin search if you ask me).

Download it from here:
http://www.mythicsoft.com/agentransack/default.aspx
 
Thanks David Candy, that has solved the problem
I have changed the registry as you suggested for each of the files not using {5e941d80-bf96-11cd-b579-08002b30bfeb} and they now search correctly
I thought I had tried this before and it had automatically changed back / hadn't saved the settings
I had used Doug Knox's xp_persisthandler.vbs to do this
I changed it manually using regedit and now it is holding the settings

This works perfectly and I would suggest to anyone with a similar problem to change the registry.
 
Back
Top