" Caffe2建筑失败"

时间:2018-02-15 02:03:34

标签: python window caffe2

当我执行指令" build_windows.bat"为了建造Caffe2,存在一个巨大的问题。

private static void Main()
{
    var defaultIndex = "listings"; 
    var settings = new ConnectionSettings(new Uri("http://localhost:9200"))
        .DefaultIndex(defaultIndex);

    var client = new ElasticClient(settings);

    // Make this example re-runnable. You likely want to remove this :)
    if (client.IndexExists(defaultIndex).Exists)
        client.DeleteIndex(defaultIndex);     

    client.CreateIndex(defaultIndex, c => c
        .Mappings(m => m
            .Map<ElasticListing>(mm => mm
                .AutoMap()
                .Properties(p => p
                    // override the default inferred mapping for Year
                    .Keyword(k => k
                        .Name(n => n.Year) 
                    )
                )
            )
        )
    );

    client.IndexMany(new [] {
        new ElasticListing { Id = 1, Year = 2012 },
        new ElasticListing { Id = 2, Year = 2013 },
        new ElasticListing { Id = 3, Year = 2014 },
        new ElasticListing { Id = 4, Year = 1014 },      
    });

    client.Refresh(defaultIndex);

    var pageSize = 10;

    // returns only document with Id = 3
    var response = client.Search<ElasticListing>(s => s
        .AllTypes()
        .Query(query => query
            .Term(f => f.Year, 2014)
        )
        .Size(pageSize)
        .Explain()
    );

    // returns documents with Ids = 3 and 4
    response = client.Search<ElasticListing>(s => s
        .AllTypes()
        .Query(query => query
            .Wildcard(f => f.Year, "*14", rewrite:(MultiTermQueryRewrite)null)
        )
        .Size(pageSize)
        .Explain()
    );
}

public class ElasticListing
{
    public long Id { get; set; }
    public string Brand { get; set; }
    public string Manufacturer { get; set; }
    public string ActiveTags { get; set; }
    public string Description { get; set; }
    public int Year { get; set; }
    public string Location { get; set; }
}

时间流逝01:02:49.30 &#34; Caffe2建筑失败&#34;

似乎有很多错误,我希望你们能帮助我! 非常感谢!

0 个答案:

没有答案