sql2000全文检索的问题,如我输入查询内容:“图壁厂1号”查询出来的内容不正确 是直接SQL中的%查询么?是不是检索的算法有问题 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 嗯,是的就是SQL2000中的全文检索那个功能,全文目录 like ‘图壁厂[1-9][0-9]号’ like ‘图壁厂[1-9][0-9]%号’ “图壁厂”这个只是个事例,我是说在sql全文检索的时候,sql他忽略了(1,2,3,4..9)这写单个数字,搜索关键字为“图壁厂1号”的搜索结果和关键字为“图壁厂”搜索的内容是一样的。但是1号要是变成两位数字(10,11....)就查询正确 你查询的时候是不是输入数字然后模糊查询?数字输入为N查询 like ‘图壁厂N%号’如果N为单位数1,2...9当然由于匹配会把1,2...9开头的数字都查询出来如果N为双位的由于查询匹配更精确查询结果正确 好象说得不是很清楚查询 like ‘图壁厂1%号’时只要字段在%两边符合就在结果里面图壁厂1号 和 图壁厂11号都满足查询要求而查询 like ‘图壁厂11%号’时只有图壁厂11号满足条件,图壁厂1号不满足 可能是SQL Server本身中文分词的问题 不是的,虽然是模糊查询的,但是这个“图壁厂”三个字我可以换成其他的字,如“加加减减1号”,我说的这个问题,是说sql2000在全文检索的时候在取关键字的时候会不会不准确,把“图壁厂1号”省略成“图壁厂” 把你 sql 语句发一下 估计是你写的问题 单词断字符的语言用neutral看看 发sql语句吧sql2000不会把“图壁厂1号”省略成“图壁厂” 下面是我写的共通 参考下 public class MCHBaseClass { private DataSet ds = new DataSet(); private string mPath = ""; public DataSet getDS() { return ds; } /// <summary> /// 加载获取的MXL 获取XML路径 /// </summary> /// <param name="path"></param> public void LoadSetting(string path) { this.mPath = path; this.ds = new DataSet(); try { ds.ReadXml(@mPath); } catch (Exception ex) { System.Console.WriteLine(ex.Message); throw; } } public DataTable Getting(string fNode) { DataTable dt = new DataTable(); try { dt = ds.Tables[fNode]; return dt; } catch (Exception ex) { System.Console.WriteLine(ex.Message); throw; } } /// <summary> /// 获取fNode父节点下第intKey行 strSection的属性值 /// </summary> /// <param name="fNode">父节电名称</param> /// <param name="intKey">行数</param> /// <param name="strSection">属性名称</param> /// <returns></returns> public string Getting(string fNode, int intKey, string strSection) { string strValue = ""; try { strValue = Convert.ToString(ds.Tables[fNode].Rows[intKey][strSection]); return strValue; } catch (Exception ex) { System.Console.WriteLine(ex.Message); throw; } } /// <summary> /// 把ds写到路径mPath下,保存成XML /// </summary> /// <param name="ds1"></param> /// <param name="mPath1"></param> public void SaveSettings(DataSet ds1, string mPath1) { try { ds1.WriteXml(@mPath1); } catch (Exception ex) { System.Console.WriteLine(ex.Message); throw; } } /// <summary> /// 更改父节点为fNode 第intKey行 strSection属性值 为strDefaultValue /// </summary> /// <param name="fNode">父节点名称</param> /// <param name="intKey">行数</param> /// <param name="strSection">属性名称</param> /// <param name="strDefaultValue">更改的值</param> public void SetSetting(string fNode, int intKey, string strSection, string strDefaultValue) { try { ds.Tables[fNode].Rows[intKey][strSection] = strDefaultValue; ds.AcceptChanges(); this.SaveSettings(ds,mPath); } catch (Exception ex) { System.Console.WriteLine(ex.Message); throw; } } /// <summary> /// 在父节点为fNode intKey行 添加 属性名称strSection 值strDefaultValue /// </summary> /// <param name="fNode">父节点名称</param> /// <param name="intKey">行数</param> /// <param name="strSection">添加的属性名称</param> /// <param name="strDefaultValue">属性值</param> public void AddSettings(string fNode, int intKey, string strSection, string strDefaultValue) { try { ds.Tables[fNode].Columns.Add(strSection); ds.Tables[fNode].Rows[intKey][strSection] = strDefaultValue; ds.AcceptChanges(); this.SaveSettings(ds, mPath); } catch (Exception ex) { System.Console.WriteLine(ex.Message); throw; } } /// <summary> /// 删除父节点为fNode下的 属性值strSection /// </summary> /// <param name="fNode"></param> /// <param name="strSection"></param> public void DeleteSettings(string fNode, string strSection) { try { ds.Tables[fNode].Columns.Remove(strSection); ds.AcceptChanges(); this.SaveSettings(ds, mPath); } catch (Exception ex) { System.Console.WriteLine(ex.Message); throw; } } } dataGridview导入导出txt C#在vista或win7下怎么控制系统音量 数据库绑定 如何重复使用一个已经填充数据的dataset? Winform下APP.config问题 通过WebBrowser向表单赋值的时候出错,请兄弟们帮帮忙,谢谢,在线等待!! 关于Microsoft.XMLHTTP 与MSXML2.XMLHTTP的一个问题 请问大家这个生成错误日志的类怎么使用? 怎样获取表中的数据信息呀 烦人的xml序列化的问题 DataGridView自定义combox数据列取值问题 C#中的问题,请各位大大们帮个忙.......
就是SQL2000中的全文检索那个功能,全文目录
我是说在sql全文检索的时候,sql他忽略了(1,2,3,4..9)这写单个数字,
搜索关键字为“图壁厂1号”的搜索结果和关键字为“图壁厂”搜索的内容是一样的。
但是1号要是变成两位数字(10,11....)就查询正确
数字输入为N
查询 like ‘图壁厂N%号’
如果N为单位数1,2...9
当然由于匹配会把1,2...9开头的数字都查询出来
如果N为双位的
由于查询匹配更精确
查询结果正确
查询 like ‘图壁厂1%号’时
只要字段在%两边符合就在结果里面
图壁厂1号 和 图壁厂11号都满足查询要求
而查询 like ‘图壁厂11%号’时
只有图壁厂11号满足条件,图壁厂1号不满足
如“加加减减1号”,
我说的这个问题,是说sql2000在全文检索的时候在取关键字的时候会不会不准确,把“图壁厂1号”省略成“图壁厂”
sql2000不会把“图壁厂1号”省略成“图壁厂”
{
private DataSet ds = new DataSet();
private string mPath = ""; public DataSet getDS()
{
return ds;
} /// <summary>
/// 加载获取的MXL 获取XML路径
/// </summary>
/// <param name="path"></param>
public void LoadSetting(string path)
{
this.mPath = path;
this.ds = new DataSet(); try
{
ds.ReadXml(@mPath);
}
catch (Exception ex)
{
System.Console.WriteLine(ex.Message);
throw;
}
} public DataTable Getting(string fNode)
{
DataTable dt = new DataTable(); try
{
dt = ds.Tables[fNode];
return dt; }
catch (Exception ex)
{
System.Console.WriteLine(ex.Message);
throw; }
} /// <summary>
/// 获取fNode父节点下第intKey行 strSection的属性值
/// </summary>
/// <param name="fNode">父节电名称</param>
/// <param name="intKey">行数</param>
/// <param name="strSection">属性名称</param>
/// <returns></returns>
public string Getting(string fNode, int intKey, string strSection)
{
string strValue = ""; try
{
strValue = Convert.ToString(ds.Tables[fNode].Rows[intKey][strSection]);
return strValue; }
catch (Exception ex)
{
System.Console.WriteLine(ex.Message);
throw;
}
} /// <summary>
/// 把ds写到路径mPath下,保存成XML
/// </summary>
/// <param name="ds1"></param>
/// <param name="mPath1"></param>
public void SaveSettings(DataSet ds1, string mPath1)
{
try
{
ds1.WriteXml(@mPath1);
}
catch (Exception ex)
{
System.Console.WriteLine(ex.Message);
throw;
}
} /// <summary>
/// 更改父节点为fNode 第intKey行 strSection属性值 为strDefaultValue
/// </summary>
/// <param name="fNode">父节点名称</param>
/// <param name="intKey">行数</param>
/// <param name="strSection">属性名称</param>
/// <param name="strDefaultValue">更改的值</param>
public void SetSetting(string fNode, int intKey, string strSection, string strDefaultValue)
{
try
{
ds.Tables[fNode].Rows[intKey][strSection] = strDefaultValue;
ds.AcceptChanges();
this.SaveSettings(ds,mPath); }
catch (Exception ex)
{
System.Console.WriteLine(ex.Message);
throw;
} } /// <summary>
/// 在父节点为fNode intKey行 添加 属性名称strSection 值strDefaultValue
/// </summary>
/// <param name="fNode">父节点名称</param>
/// <param name="intKey">行数</param>
/// <param name="strSection">添加的属性名称</param>
/// <param name="strDefaultValue">属性值</param>
public void AddSettings(string fNode, int intKey, string strSection, string strDefaultValue)
{
try
{
ds.Tables[fNode].Columns.Add(strSection);
ds.Tables[fNode].Rows[intKey][strSection] = strDefaultValue;
ds.AcceptChanges();
this.SaveSettings(ds, mPath);
}
catch (Exception ex)
{
System.Console.WriteLine(ex.Message);
throw;
}
} /// <summary>
/// 删除父节点为fNode下的 属性值strSection
/// </summary>
/// <param name="fNode"></param>
/// <param name="strSection"></param>
public void DeleteSettings(string fNode, string strSection)
{
try
{
ds.Tables[fNode].Columns.Remove(strSection);
ds.AcceptChanges();
this.SaveSettings(ds, mPath);
}
catch (Exception ex)
{
System.Console.WriteLine(ex.Message);
throw;
}
}
}