Discussion:
Index server refuses to generate characterizations
(too old to reply)
jeremypollack
2007-03-21 18:41:31 UTC
Permalink
Hey all,

Trying to do something simple here. I created a catalog for my site,
and am trying to query it. Generally, querying seems to work, but the
one thing I cannot get it to do is retrieve characterizations.

Yes, I did go to Catalog->Properties->Generation, turn off "Inherit
above settings from service" and turn on "Generate abstracts"
Yes, I have restarted the service and done a Rescan (Full) on all of
my indexed directories.

Here is my code :

protected void btnSearch_Click(object sender, EventArgs e)
{
lblOut.Text = "";

OleDbConnection connection = null;
OleDbCommand command = null;
OleDbDataReader reader = null;
string searchText = txtSearch.Text.Replace("'", "''");

connection = new OleDbConnection();
connection.ConnectionString = "Provider=MSIDXS; Data Source=
\"Babble\";";
connection.Open();

command = connection.CreateCommand();
command.CommandText = "select * from WEBINFO where
FREETEXT(Contents, '" + searchText + "') order by rank desc ";
command.CommandType = CommandType.Text;

reader = command.ExecuteReader();

while (reader.Read())
{
lblOut.Text += ((string)reader["path"]) +
((string)reader["filename"]) + " : " +
((string)reader["characterization"]) + "<br/><br/>";
}

reader.Dispose();
connection.Dispose();
}

When I click the button to do a search, I get the following error on
the line where I write the output to lblOut:
Unable to cast object of type 'System.DBNull' to type 'System.String'.

(and yes, this is test code, which is why I'm not doing any validation
checks)

Anybody know what I could be doing wrong?

--Jeremy
Gang_Warily
2007-03-21 19:30:27 UTC
Permalink
Hi

This may be a silly question, but have you made the characterization
retrievable (cached) ?
I think it's query-only in the catalog by default, not readable.

http://msdn2.microsoft.com/en-us/library/ms951672.aspx

To add meta properties to the property cache, invoke the Index Server
Microsoft Management Console (MMC) administration tool. Open the catalog and
select Properties from the tree view. Select the property to be added and
then right-click it. Then click Properties and check the Cached box.

Documents must be reindexed.

Eric
Post by jeremypollack
Hey all,
Trying to do something simple here. I created a catalog for my site,
and am trying to query it. Generally, querying seems to work, but the
one thing I cannot get it to do is retrieve characterizations.
Yes, I did go to Catalog->Properties->Generation, turn off "Inherit
above settings from service" and turn on "Generate abstracts"
Yes, I have restarted the service and done a Rescan (Full) on all of
my indexed directories.
protected void btnSearch_Click(object sender, EventArgs e)
{
lblOut.Text = "";
OleDbConnection connection = null;
OleDbCommand command = null;
OleDbDataReader reader = null;
string searchText = txtSearch.Text.Replace("'", "''");
connection = new OleDbConnection();
connection.ConnectionString = "Provider=MSIDXS; Data Source=
\"Babble\";";
connection.Open();
command = connection.CreateCommand();
command.CommandText = "select * from WEBINFO where
FREETEXT(Contents, '" + searchText + "') order by rank desc ";
command.CommandType = CommandType.Text;
reader = command.ExecuteReader();
while (reader.Read())
{
lblOut.Text += ((string)reader["path"]) +
((string)reader["filename"]) + " : " +
((string)reader["characterization"]) + "<br/><br/>";
}
reader.Dispose();
connection.Dispose();
}
When I click the button to do a search, I get the following error on
Unable to cast object of type 'System.DBNull' to type 'System.String'.
(and yes, this is test code, which is why I'm not doing any validation
checks)
Anybody know what I could be doing wrong?
--Jeremy
jeremypollack
2007-03-21 20:03:36 UTC
Permalink
Thanks for the suggestion, but that doesn't seem to be the problem.
The characterization appears to be cached in secondary storage.

Is there any additional information that I could provide that would
help diagnose this problem?

--Jeremy
Post by Gang_Warily
Hi
This may be a silly question, but have you made the characterization
retrievable (cached) ?
I think it's query-only in the catalog by default, not readable.
http://msdn2.microsoft.com/en-us/library/ms951672.aspx
To add meta properties to the property cache, invoke the Index Server
Microsoft Management Console (MMC) administration tool. Open the catalog and
select Properties from the tree view. Select the property to be added and
then right-click it. Then click Properties and check the Cached box.
Documents must be reindexed.
Eric
Post by jeremypollack
Hey all,
Trying to do something simple here. I created a catalog for my site,
and am trying to query it. Generally, querying seems to work, but the
one thing I cannot get it to do is retrieve characterizations.
Yes, I did go to Catalog->Properties->Generation, turn off "Inherit
above settings from service" and turn on "Generate abstracts"
Yes, I have restarted the service and done a Rescan (Full) on all of
my indexed directories.
protected void btnSearch_Click(object sender, EventArgs e)
{
lblOut.Text = "";
OleDbConnection connection = null;
OleDbCommand command = null;
OleDbDataReader reader = null;
string searchText = txtSearch.Text.Replace("'", "''");
connection = new OleDbConnection();
connection.ConnectionString = "Provider=MSIDXS; Data Source=
\"Babble\";";
connection.Open();
command = connection.CreateCommand();
command.CommandText = "select * from WEBINFO where
FREETEXT(Contents, '" + searchText + "') order by rank desc ";
command.CommandType = CommandType.Text;
reader = command.ExecuteReader();
while (reader.Read())
{
lblOut.Text += ((string)reader["path"]) +
((string)reader["filename"]) + " : " +
((string)reader["characterization"]) + "<br/><br/>";
}
reader.Dispose();
connection.Dispose();
}
When I click the button to do a search, I get the following error on
Unable to cast object of type 'System.DBNull' to type 'System.String'.
(and yes, this is test code, which is why I'm not doing any validation
checks)
Anybody know what I could be doing wrong?
--Jeremy
jeremypollack
2007-03-21 20:23:54 UTC
Permalink
Ok, apparently this is now working on my Windows Server 2003 machine,
but still doesn't work on my XP machine.

Is there anything specific to XP that would cause this to fail?

--Jeremy
Post by jeremypollack
Thanks for the suggestion, but that doesn't seem to be the problem.
The characterization appears to be cached in secondary storage.
Is there any additional information that I could provide that would
help diagnose this problem?
--Jeremy
Post by Gang_Warily
Hi
This may be a silly question, but have you made the characterization
retrievable (cached) ?
I think it's query-only in the catalog by default, not readable.
http://msdn2.microsoft.com/en-us/library/ms951672.aspx
To add meta properties to the property cache, invoke the Index Server
Microsoft Management Console (MMC) administration tool. Open the catalog and
select Properties from the tree view. Select the property to be added and
then right-click it. Then click Properties and check the Cached box.
Documents must be reindexed.
Eric
Post by jeremypollack
Hey all,
Trying to do something simple here. I created a catalog for my site,
and am trying to query it. Generally, querying seems to work, but the
one thing I cannot get it to do is retrieve characterizations.
Yes, I did go to Catalog->Properties->Generation, turn off "Inherit
above settings from service" and turn on "Generate abstracts"
Yes, I have restarted the service and done a Rescan (Full) on all of
my indexed directories.
protected void btnSearch_Click(object sender, EventArgs e)
{
lblOut.Text = "";
OleDbConnection connection = null;
OleDbCommand command = null;
OleDbDataReader reader = null;
string searchText = txtSearch.Text.Replace("'", "''");
connection = new OleDbConnection();
connection.ConnectionString = "Provider=MSIDXS; Data Source=
\"Babble\";";
connection.Open();
command = connection.CreateCommand();
command.CommandText = "select * from WEBINFO where
FREETEXT(Contents, '" + searchText + "') order by rank desc ";
command.CommandType = CommandType.Text;
reader = command.ExecuteReader();
while (reader.Read())
{
lblOut.Text += ((string)reader["path"]) +
((string)reader["filename"]) + " : " +
((string)reader["characterization"]) + "<br/><br/>";
}
reader.Dispose();
connection.Dispose();
}
When I click the button to do a search, I get the following error on
Unable to cast object of type 'System.DBNull' to type 'System.String'.
(and yes, this is test code, which is why I'm not doing any validation
checks)
Anybody know what I could be doing wrong?
--Jeremy
jeremypollack
2007-03-23 15:10:02 UTC
Permalink
Eventually got this to work. This is going to sound silly, but I had
to delete and re-create the catalog a number of times. Don't know
quite what the deal is with this.

I did notice that sometimes it wouldn't turn caching on by default, so
I made sure that it was on.

--Jeremy
Post by jeremypollack
Ok, apparently this is now working on my Windows Server 2003 machine,
but still doesn't work on my XP machine.
Is there anything specific to XP that would cause this to fail?
--Jeremy
Post by jeremypollack
Thanks for the suggestion, but that doesn't seem to be the problem.
The characterization appears to be cached in secondary storage.
Is there any additional information that I could provide that would
help diagnose this problem?
--Jeremy
Post by Gang_Warily
Hi
This may be a silly question, but have you made the characterization
retrievable (cached) ?
I think it's query-only in the catalog by default, not readable.
http://msdn2.microsoft.com/en-us/library/ms951672.aspx
To add meta properties to the property cache, invoke the Index Server
Microsoft Management Console (MMC) administration tool. Open the catalog and
select Properties from the tree view. Select the property to be added and
then right-click it. Then click Properties and check the Cached box.
Documents must be reindexed.
Eric
Post by jeremypollack
Hey all,
Trying to do something simple here. I created a catalog for my site,
and am trying to query it. Generally, querying seems to work, but the
one thing I cannot get it to do is retrieve characterizations.
Yes, I did go to Catalog->Properties->Generation, turn off "Inherit
above settings from service" and turn on "Generate abstracts"
Yes, I have restarted the service and done a Rescan (Full) on all of
my indexed directories.
protected void btnSearch_Click(object sender, EventArgs e)
{
lblOut.Text = "";
OleDbConnection connection = null;
OleDbCommand command = null;
OleDbDataReader reader = null;
string searchText = txtSearch.Text.Replace("'", "''");
connection = new OleDbConnection();
connection.ConnectionString = "Provider=MSIDXS; Data Source=
\"Babble\";";
connection.Open();
command = connection.CreateCommand();
command.CommandText = "select * from WEBINFO where
FREETEXT(Contents, '" + searchText + "') order by rank desc ";
command.CommandType = CommandType.Text;
reader = command.ExecuteReader();
while (reader.Read())
{
lblOut.Text += ((string)reader["path"]) +
((string)reader["filename"]) + " : " +
((string)reader["characterization"]) + "<br/><br/>";
}
reader.Dispose();
connection.Dispose();
}
When I click the button to do a search, I get the following error on
Unable to cast object of type 'System.DBNull' to type 'System.String'.
(and yes, this is test code, which is why I'm not doing any validation
checks)
Anybody know what I could be doing wrong?
--Jeremy
Loading...