您在此处:
编辑并测试 Solr 查询
将引用 Atom XSL 文件的参数添加到 Solr 查询。然后,测试更改,以确保结果以 XML Atom 格式显示。
-
将这些参数添加到 Solr 查询:
wt=xslt和tr=file_name.xsl,其中 file_name 是 Atom XSL 文件的名称。例如,tr=acme.xsl。 - 使用此 URL 测试查询:http://localhost:8983/solr/techproducts/select?q=sd500&wt=xslt&tr=example_atom.xsl。在此测试中,内核名称是 techproducts,搜索词是 sd500。
此处是格式为 Atom XML 的响应示例。
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Example Solr Atom 1.0 Feed</title>
<subtitle>
This has been formatted by the sample "example_atom.xsl" transform - use your own XSLT to get a nicer Atom feed.
</subtitle>
<author>
<name>Apache Solr</name>
<email>solr-user@lucene.apache.org</email>
</author>
<link rel="self" type="application/atom+xml" href="http://localhost:8983/solr/q=sd500&wt=xslt&tr=atom.xsl"/>
<updated/>
<id>tag:localhost,2007:example</id>
<entry>
<title>Canon PowerShot SD500</title>
<link href="http://localhost:8983/solr/select?q=9885A004"/>
<id>tag:localhost,2007:9885A004</id>
<summary>
3x zoop, 7.1 megapixel Digital ELPHmovie clips up to 640x480 @30 fps2.0" TFT LCD, 118,000 pixelsbuilt in flash, red-eye reduction
</summary>
<updated/>
</entry>
</feed>
