views:

61

answers:

1

Hello,

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 follows:

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

+2  A: 

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.

Mauricio Scheffer
that's what I thought. does that mean that highlighting functionality is really only meant for index pages rather than detail pages? I'm confused as to how it would work otherwise...
JP
@JP: you can use highlighting for both.
Mauricio Scheffer
i may be (probably am) really slow, but how do you reconcile loading something by id (or indexed fields) with doing a search that includes highlighting? surely highlighting requires a more complex query from the detail page that increases the complexity of the lookup? your help is much appreciated!
JP
Mauricio Scheffer
makes sense, thanks!
JP