Friday, March 30, 2007

Query Textml for Documents by Size and Collection

I wanted to search Textml for documents over a certain size and in a particular collection to help track down some problems we were having. Here's a query that does it:
<?xml version="1.0" encoding="UTF-16"?>
<query VERSION="3.6" RESULTSPACE="R1">
<andkey>
<property NAME="Collection">
<elem>/encyclopedias/<anystr></elem>
</property>
<property NAME="Size">
<interval>
<start INCLUSIVE="True">
<number>100000</number>
</start>
</interval>
</property>
</andkey>
</query>
Note that you can also set the upper limit for the interval by using the <end> element.

Wednesday, March 21, 2007

SELECT Using a Full Text Catalog in SQL Server

This is a pretty simple example. There's a heck of a lot more that you can do.
SELECT Distinct(i.imageFile), i.caption, i.fileID, i.fragmentID, i.path, c.title 
FROM metadata_image AS m JOIN image AS i ON m.image_id=i.id
LEFT JOIN fragments AS c ON i.fragmentID=c.cid
WHERE Contains(i.*, '"some" or "word"') OR
Contains(c.*, '"some" or "word"') OR
Contains(m.*, '"some" or "word"')
ORDER BY c.title, i.caption

ALTER Full Text Catalogs in SQL Server 2005 for Diacritic Sensitivity

Pretty simple:
USE AdventureWorks;
GO
ALTER FULLTEXT CATALOG ftCatalog
REBUILD WITH ACCENT_SENSITIVITY=OFF;
GO

Tuesday, March 20, 2007

SELECT Duplicate Records with Matching IDs

So painfully simple, but I can never remember this when I need it, so here it is!
SELECT l.fileid, l.title, a.title
FROM pub_books AS l
JOIN books AS a
ON l.fileid = a.fileid

Monday, March 12, 2007

"Index was outside the bounds of the array" Error and VS.NET 2005 SP1

After upgrading my Visual Studio.NET 2005 installation to SP1, none of my website applications would publish. Aggravating. I started getting the hideously vague error "Index was outside the bounds of the array." Here are some suggestions on how to handle this problem.

http://forums.asp.net/thread/1499559.aspx

http://msdn2.microsoft.com/en-us/asp.net/aa336619.aspx

My solution was to go into my Projects/[project name]/ directory and rename the current directory, there from my last Publish run, and then to try and publish it again. This worked for all of my projects.