是直接SQL中的%查询么?是不是检索的算法有问题

解决方案 »

  1.   

    嗯,是的
    就是SQL2000中的全文检索那个功能,全文目录
      

  2.   

    like ‘图壁厂[1-9][0-9]号’
      

  3.   

    like ‘图壁厂[1-9][0-9]%号’
      

  4.   

    “图壁厂”这个只是个事例,
    我是说在sql全文检索的时候,sql他忽略了(1,2,3,4..9)这写单个数字,
    搜索关键字为“图壁厂1号”的搜索结果和关键字为“图壁厂”搜索的内容是一样的。
    但是1号要是变成两位数字(10,11....)就查询正确
      

  5.   

    你查询的时候是不是输入数字然后模糊查询?
    数字输入为N
    查询 like ‘图壁厂N%号’
    如果N为单位数1,2...9
    当然由于匹配会把1,2...9开头的数字都查询出来
    如果N为双位的
    由于查询匹配更精确
    查询结果正确
      

  6.   

    好象说得不是很清楚
    查询 like ‘图壁厂1%号’时
    只要字段在%两边符合就在结果里面
    图壁厂1号  和 图壁厂11号都满足查询要求
    而查询 like ‘图壁厂11%号’时
    只有图壁厂11号满足条件,图壁厂1号不满足
      

  7.   

    可能是SQL Server本身中文分词的问题 
      

  8.   

    不是的,虽然是模糊查询的,但是这个“图壁厂”三个字我可以换成其他的字,
    如“加加减减1号”,
    我说的这个问题,是说sql2000在全文检索的时候在取关键字的时候会不会不准确,把“图壁厂1号”省略成“图壁厂”
      

  9.   

    把你 sql 语句发一下  估计是你写的问题
      

  10.   

    单词断字符的语言用neutral看看
      

  11.   

    发sql语句吧
    sql2000不会把“图壁厂1号”省略成“图壁厂”
      

  12.   

    下面是我写的共通 参考下 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;
                }
            }
        }