The amazing adventures of Doug Hughes

Archive for August, 2005

Problems Creating Full Text Index in MSSQL 2000 on Windows Server 2003

I recently needed to add a full text index on a table in a Microsoft SQL database. However, any time I tried to enable full text indexing on my database I received this obnoxious error: “The Microsoft Search service cannot be administered under the present user account.”

I Googled this message and didn’t come up with anything that seemed to help. I was able to deduce that this message (and several related messages) crop up when the user account under which MSSQL is running doesn’t have permission to access the Microsoft Search service.

Most of the advice I saw was to access the SQL Server properties though Enterprise Manager. From this, click on the Security tab and change the startup account to the System account and restart the SQL server. After this, you needed to repeat this process and change it back to the user account you want to run the SQL server under.

The reason you’re supposed to do this is that apparently when you change the account under which SQL Server runs from the properties panel, SQL Server adds the provided user account as an administrator for the Search service. Most of these problems seem to come from changing the SQL Server user account in from the Services control panel, which will not cause the Search service to be updated correctly.

This was a distinct possibility for my server so I tried this. Unfortunately it didn’t work.

After a bit more creative Googling, I found this link, which unfortunately requires you to register and log in. So, after registering (and probably committing myself to a life of even more spam), I logged in and read what turned out to be a message board post.

About half way down someone named “georgedo” posted the following steps to follow. There was no explanation as to what these steps were supposed to actually do. I decided to blindly follow the instructions and see what happened. (You might not want to try this at home.)

The steps were as follows:

  1. Search for the file named “ftsetup.exe” on the SQL server and note it’s location. I found mine under “C:Program FilesMicrosoft SQL ServerMSSQLBinn”.
  2. Open a command prompt to the path found in step 1.
  3. Execute this command: “ftsetup.exe sqlserver 0 1 0 0 0 4 “. I have no idea what this is supposed to do.
  4. The instructions said to note the result from this command. I don’t know why. It didn’t seem to matter. Mine returned this message: “FulltextSetup returned error code: 0x0”.
  5. At this point I diverged slightly from the instructions. I did a search for the file “sqlfth75.dll ” and noted it’s location.
  6. Open a command prompt to the path found in step 5.
  7. Run this command: “regsvr32 sqlfth75.dll “
  8. Restart the Microsoft Search and MSSQLSERVER services.

I followed those steps. Much to my amazement, it worked!

So, the moral of the story is that you should blindly trust people on the web who seem to know what they’re talking about. Well maybe not. Luckily, in this case it worked out for me. If you’re having the same problem you might want to try this too. If you have problems, track down “georgedo” and pester him!

A Quick Verity Gotcha – And One Quick Solution

Today, I was attempting to create a new Verity collection on ColdFusion MX 7. However, I don’t work with Verity very frequently and did something wrong. I either tried to create a collection at a path with illegal characters in the filename, or I tried to use a mapping as the path to create the collection. Either way, the collection seemed to be partially created, but errors were thrown by ColdFusion.

Event after fixing the path (by using expandPath), subsequent calls to cfcollection to create a collection were throwing the following error message:

Message:
An error occurred while performing an operation in the Search Engine library.

Detail:
Error opening the collection: com.verity.organize.WorkSpaceException: Path not found [VdkError_PathNotFound]. (-104)

A quick Google search produced this Macromedia TechNote. This link provides the following instructions to resolve this problem (quoted directly from that link.):

  1. Stop the ColdFusion MX 7 Search Server service.
  2. Delete all of the directories under the cf_root verityDataservicesColdFusionK2_indexserver1ws directory.
  3. Restart the ColdFusion MX 7 Search Server service.

Sure enough, I followed those steps and it worked like a charm. The only issue I had was finding the correct path to the verity folder when I’m running under JRun. Turns out this was c:jrunverity.

Random Note of The Day: The word "Macromedia" is not in the DreamWeaver spell checker!

Lessen Moire Patterns in Scanned Images With the Alagad Image Component

I received an email today from an Image Component user. This person works for a museum in New York and was working on a project apparently related to making archived digital pictures available online. Many of their pictures were scanned from printed materials and, unfortunately, had a very strong moir pattern. When the image was scaled down using the Image Component the pattern became very apparent.

For those of you that don’t know what a moir pattern is, it’s a funny, repeating pattern you get when you scan printed images. This comes from the fact that printed images are made up of tiny little dots, similar to pixels, but a different pattern.

When you scan these images, the translation from the offset dot pattern to a computer pixel system creates a very obvious pattern in the image. When you scale the image down this pattern usually becomes even more apparent.

For more information, visit this link: http://www.scantips.com/basics06.html .

Most scanners have a setting called “descreen” which applies an algorithm which removes this pattern when you’re doing the scan. This is the best time to fix these types of problems. Unfortunately, the images the museum was working with had no been descreened and the resulting scaled images were not pretty.

Here’s an example with the moir pattern. The image is obviously of very poor quality.

Moire Example

If you’re working in some software like Photoshop, there are techniques you can apply to reduce this effect. Generally, this is to have an image two to three times the size you need the image to be. You then apply a median filter of two or three pixels, scale the image to the target size, then apply an unsharp mask.

The Image Component isn’t exactly as powerful as photoshop. However, the purpose really is to average a set of 4 or 6 pixels so they are roughly the same color. Then, scale them down and their resampled pixels should end up the correct color. So, before rescaling the image I applied a 3-pixel blur. (The AIC has an annoying feature where blurred images get a black border around them. To prevent that I increased the image canvas size before burring then cropped it back out.) I then re-read the unaltered image and drew it back over the blurred version at 30% transparency. The purpose of this was to bring some sharpness back into the image.

Finally, I resized the image to the target size. This process did a pretty good job of lessening the moir effect. It’s not gone, but it’s a lot better than it was. Here’s the result with this technique applied:

Moire Thumbnail

The code I wrote is as follows. (You’ll need the Image Component to do this. Download it here .)

<cfset myImage=CreateObject("Component", "Image")/>
<cfset myImage.readImage(expandPath("moire.jpg"))/>

<!--- increase the size of the canvas by the number of pixels we're going to blur * 2 --->
<cfset myImage.setImageSize(myImage.getWidth() + 6, myImage.getHeight() + 6, "middleCenter")/>

<!--- blur the image --->
<cfset myImage.blur(2,2)/>

<!--- crop the image down to the old size --->
<cfset myImage.setImageSize(myImage.getWidth() - 6, myImage.getHeight() - 6, "middleCenter")/>

<!--- read the original image and write it overtop of the current image at 30% transparency --->
<cfset myImage.setTransparency(20)/>
<cfset myImage.drawImage(expandPath("moire.jpg"), 0, 0)/>

<!--- lastly, scale --->
<cfset myImage.scaleToFit(257)/>
<cfset myImage.writeImage(expandPath("thumbnail.jpg"), "jpg")/>

Cool, eh?

Tag Cloud