http://localhost/myBlog/solr-rocks.html Solr Search is Simply Great solr,lucene,enterprise,search 2007-01-06T05:04:00.000Z 10 Solr is a really great open source search server. It scales, it's easy to configure and the Solr community is really supportive. on
清单 1 的 中的每个 field 条目告诉 Solr 应该将哪些 Field 添加到所创建文档的 Lucene 索引中。可以向 add 命令添加多个。稍后我将解释 Solr 如何处理这些 field。现在,知道包含清单 1 中指定的七个 field 的文档将会被索引就足够了。
当您在 “Solr XML Command” 页面提交命令时,结果将发往 Solr 进行处理。HTTP POST 将命令发往在 http://localhost:8080/solr/update 运行的 Solr Update Servlet。如果一切进展顺利,则会随 返回一个 XML 文档。Solr 使用相同的 URL 自动更新文档(示例应用程序中的 URL 是 Solr 识别文档以前是否被添加过所使用的惟一 id)。
搜索命令
添加文档后,就可以搜索这些文档了。Solr 接受 HTTP GET 和 HTTP POST 查询消息。收到的查询由相应的 SolrRequestHandler 进行处理。出于本文的讨论目的,我们将使用默认的 StandardRequestHandler。在本文的第 2 部分,我将向您展示如何为其他的SolrRequestHandler 配置 Solr。
要查看搜索运行,返回到示例应用程序并浏览到 http://localhost:8080/dw/searching.jsp。此屏幕应该与索引屏幕非常类似,只是增加了几个搜索相关的选项。与索引类似,可以向各种输入字段中输入值,选择搜索参数并将查询提交给示例应用程序。示例应用程序醒目显示了一些 Solr 中更常见的查询参数。这些参数如下所示:
0 6 10 0 *,score true content:"faceted browsing" 1.058217 http://localhost/myBlog/solr-rocks-again.html Solr is Great solr,lucene,enterprise,search,greatness Solr has some really great features, like faceted browsing and replication Solr has some really great features, like faceted browsing and replication 2007-01-07T05:04:00.000Z solr,lucene,enterprise,search,greatness 8 Solr is Great http://localhost/myBlog/solr-rocks-again.html Solr has some really great features, like faceted browsing and replication