小编Deb*_*yay的帖子

如何在SQL Server中的多语言内容中实现全文搜索

我们有一个支持不同语言的网站.我们有数百万的数据,因此在搜索中我们希望实现SQL Server全文搜索.

我们目前在下面的表结构.

CREATE TABLE Product
(
   ID INT IDENTITY(1,1),
   Code VARCHAR(50),
   ........
   ........
)

CREATE TABLE ProductLanguage
(
   ID INT,
   LanguageID INT,
   Name NVARCHAR(200),
   ........
   ........
)
Run Code Online (Sandbox Code Playgroud)

我们希望在"名称"列中实现全文搜索,以便我们在"名称"列上创建全文索引.但是在创建全文索引时,我们每列只能选择一种语言.如果我们选择"英语"或"中立",它不会返回其他语言的预期数据,如日语,中文,法语等.

那么在SQL Server中实现多语言内容的全文搜索的最佳方法是什么呢?

我们需要创建一个不同的表.如果是,那么表格结构是什么(我们需要记住语言不固定,以后可以添加不同的语言)以及搜索查询是什么?

我们正在使用SQL Server 2008 R2.

sql t-sql sql-server sql-server-2008 c#-4.0

5
推荐指数
1
解决办法
1076
查看次数

在C#中创建动态<T>

我需要使用界面创建Dynamic T. 但我收到"Type Casting"错误.这是我的代码:

interface IEditor { }

class Editor : IEditor { }

class Test<T> { }
Run Code Online (Sandbox Code Playgroud)

现在这将是动态的,所以我使用下面的代码:

Test<IEditor> lstTest = (Test<IEditor>)Activator.CreateInstance(typeof(Test<>).MakeGenericType(typeof(Editor)));
Run Code Online (Sandbox Code Playgroud)

我收到了以下错误

无法转换类型为"CSharp_T.Test"1 [CSharp_T.Editor]'的对象以键入"CSharp_T.Test"1 [CSharp_T.IEditor]'.

此错误不是编译错误,但我得到运行时错误.

c# c#-4.0

3
推荐指数
1
解决办法
520
查看次数

Google折线图线不透明度

有什么方法可以更改Google折线图中的折线不透明度吗?

我正在使用以下代码:

function drawLineChart() {
        var data = google.visualization.arrayToDataTable([
          ['Year', 'Sales', 'Expenses'],
          ['2004', 1000, 400],
          ['2005', 1170, 460],
          ['2006', 660, 1120],
          ['2007', 1030, 540]
        ]);


        var options1 = {
            legend: { position: 'bottom', maxLines: 3 },
            trendlines: {
                1: {
                    type: 'linear',
                    color: 'green',
                    lineWidth: 10,
                    opacity: 0.3,
                    showR2: true,
                    visibleInLegend: true
                }
            },
            title: 'Company Performance'
        };


        var chart = new google.visualization.LineChart(document.getElementById('chart_div'));

        chart.draw(data, options1);
    }
Run Code Online (Sandbox Code Playgroud)

google-visualization

0
推荐指数
1
解决办法
2283
查看次数

在单元测试项目中访问Sitecore上下文

我想访问MS Test Project中的sitecore上下文.我正在使用Sitecore 8.1和使用VS 2005的MS测试项目(Framework:4.5.2)我按照这里的一些说明http://getfishtank.ca/blog/unit-testing-in-sitecore-with-context-和APP-配置

所以我在单元测试项目中拥有所有必需的DLLS和sitecore配置文件.

我的代码如下:

    [TestMethod]
    public void TestMethod1()
    {
        State.HttpRuntime.AppDomainAppPath = Directory.GetCurrentDirectory();

        string dataFolder = Sitecore.Configuration.Settings.DataFolder;
        string licenseFile = Settings.LicenseFile;

        var db = Sitecore.Configuration.Factory.GetDatabase("master");
        var home = db.GetItem("/sitecore/content/");
        Assert.AreEqual(5, 5);
    }
Run Code Online (Sandbox Code Playgroud)

现在我收到以下错误:

        Result StackTrace:  
    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName …
Run Code Online (Sandbox Code Playgroud)

c# unit-testing sitecore sitecore8

0
推荐指数
1
解决办法
2096
查看次数