本文整理汇总了C#中SolrNet.Impl.QuerySerializers.DefaultQuerySerializer.Serialize方法的典型用法代码示例。如果您正苦于以下问题:C# DefaultQuerySerializer.Serialize方法的具体用法?C# DefaultQuerySerializer.Serialize怎么用?C# DefaultQuerySerializer.Serialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SolrNet.Impl.QuerySerializers.DefaultQuerySerializer
的用法示例。
在下文中一共展示了DefaultQuerySerializer.Serialize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Boost_with_high_value
public void Boost_with_high_value()
{
var q = new SolrQueryBoost(new SolrQuery("solr"), 34.2E10);
var serializer = new DefaultQuerySerializer(new DefaultFieldSerializer());
var query = serializer.Serialize(q);
Assert.AreEqual("(solr)^342000000000", query);
}
示例2: SolrQuery_Boost
public void SolrQuery_Boost()
{
var q = new SolrQuery("solr").Boost(12.2);
var serializer = new DefaultQuerySerializer(new DefaultFieldSerializer());
var query = serializer.Serialize(q);
Assert.AreEqual("(solr)^12.2", query);
}
示例3: Query
public void Query()
{
var q = new SolrHasValueQuery("name");
var serializer = new DefaultQuerySerializer(new DefaultFieldSerializer());
var query = serializer.Serialize(q);
Assert.AreEqual("name:[* TO *]", query);
}
示例4: Serialize
public string Serialize(object q)
{
var serializer = new DefaultQuerySerializer(new DefaultFieldSerializer());
return serializer.Serialize(q);
}