简体   繁体   English

Solrnet和ASP.NET MVC

[英]solrnet and ASP.NET MVC

I noticed in the solrnet examples it is not possible to drill down into search results. 我在solrnet示例中注意到无法深入搜索结果。 That is, you are presented with a list of products but cannot see the details for those products. 也就是说,系统会向您显示产品列表,但看不到这些产品的详细信息。

My question is as follows: 我的问题如下:

The MVC controller that calls SOLR and populates the index page essentially contains the model for each detail view. 调用SOLR并填充索引页的MVC控制器实质上包含每个详细视图的模型。 Specifically, if i have large text fields and care about advanced features like highlighting, SOLR will return everything I need for that detail page when I complete my search. 具体来说,如果我的文本字段很大,并且关心突出显示等高级功能,那么在我完成搜索后,SOLR将返回该详细信息页面所需的一切。 Since I'm pulling all of this information for the index page, what is the best way of loading a detail page when I click an item on the index page? 由于我要为索引页面提取所有这些信息,因此单击索引页面上的项目时加载详细页面的最佳方法是什么? If i use an actionlink i will invariably end up retrieving the data (from solr or a relational database) all over again. 如果我使用动作链接,我将不可避免地最终重新从(从solr或关系数据库中)检索数据。

Any thoughts or experience would be much appreciated, 任何想法或经验将不胜感激,

Thanks in advance 提前致谢

JP J.P

Just as you would do it with a relational database, you issue two different queries: one for searching, another for the detail page. 就像使用关系数据库一样,您将发出两个不同的查询:一个用于搜索,另一个用于详细信息页面。 Remember that the web is stateless. 请记住,网络是无国籍的。

If you have a huge text field that your don't want in your search results, but want it in your detail page, then exclude it from the search query (use a projection ). 如果您有一个不需要的大型文本字段,但是想要在详细信息页面中使用它,则可以将其从搜索查询中排除(使用投影 )。

The query for the detail page should be very simple, something like Query.Field("id").Is(Request.QueryString["id"]) , no need for filter queries, facets, spell corrections or other stuff that is usually used for searching. 详细信息页面的查询应该非常简单,类似于Query.Field("id").Is(Request.QueryString["id"]) ,不需要过滤器查询,构面,拼写更正或其他通常需要的内容用于搜索。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM