solrnet and ASP.NET MVC
I noticed in the solrnet examples it is not possible to drill down into search results. That is, you are presented with a list of products but cannot see the details for those products.
My question is as foll开发者_开发知识库ows:
The MVC controller that calls SOLR and populates the index page essentially contains the model for each detail view. 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. 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.
Any thoughts or experience would be much appreciated,
Thanks in advance
JP
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.
精彩评论