小编Fou*_*our的帖子

有没有办法使用Solr Net获得solr分组的结果

我想尝试solr 3.3中包含的新solr collapsing/grouping,我在solr管理页面上尝试过查询,但是当我尝试使用solr net查询我的c#代码时,它似乎无法按预期工作.以下是我设置参数值的方法

    options.ExtraParams = new List<KeyValuePair<string, string>>
    {
        new KeyValuePair<string,string>("group","true"),
        new KeyValuePair<string,string>("group.field","AuthorID"),
    };
Run Code Online (Sandbox Code Playgroud)

solrnet

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

XSLT:Foreach迭代每个项目,但显示第一个项目的值?

我有一个项目列表,我希望每个项目都成为一个网址.

列表:

 <root>
   <tags>
     <tag>open source</tag>
     <tag>open</tag>
     <tag>advertisement</tag>
     <tag>ad</tag>
   </tags>
 </root>
Run Code Online (Sandbox Code Playgroud)

XSLT:

<xsl:template match="*">
    <div class="tags">
      <xsl:for-each select="/post/tags/tag">
          <a href="#">
            <xsl:value-of select="//tag"/>
          </a>
      </xsl:for-each>
    </div>
</xsl:template>
Run Code Online (Sandbox Code Playgroud)

输出:

  <div class="tags"> 
    <a href="#">open source</a> 
    <a href="#">open source</a> 
    <a href="#">open source</a> 
    <a href="#">open source</a> 
  </div> 
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

xslt foreach

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

标签 统计

foreach ×1

solrnet ×1

xslt ×1