开发者

Apache Lucene Solr4.0, help with solrconfig.xml or query string for multi match task

I'm learning Apache Lucene Solr4.0 syntax and functionality and would like to make a minimum number of requests on a single page.

It is my understanding that this can be achieved by either creating a Query String (thour a combination of group, facet, etc.) or by creating a requestHandler in solrconfig.xml, either way works for me

This page particularly displays at the minimum 4 different sets of product data and a list of categories:

Products is a list of products

  • Most Wanted - list of 6 products that have been marked as wanted by many users
  • Most Offered - list of 6 products that have been marked as users offer this products
  • Most Wanted this week - 1 product that was in the highest demand this week
  • Random products - 5 randomly selected products that are available on the site
  • List of all product categories with the respective product count in each category

Would also be nice to have: For Most wanted this week - a list of 5 products that people are offering in return for this product

Sample data:

[TABLE PRODUCTS]
| ProductID | CategoryID | Title |
|     1     |     1      | Hat   |
|     2     |     2      | Soap  | 
|     3     |     1      | Tail  |
[WANT LIST]
| ID   | ProductID | UserID | DateAdded  |
|  1   |     1     |    1   | 2011-01-01 |
|  2   |     1     |    2   | 2011-06-01 |
|  3   |     1     |    4   | 2011-06-03 |
|  4   |     2     |    5   | 2011-01-01 |
|  5   |     2     |    6   | 2011-01-01 |
[HAVE LIST]
| ID   | ProductID | UserID | DateAdded  |
|  1   |     1     |   开发者_运维知识库 1   | 2011-01-01 |
|  2   |     1     |    2   | 2011-06-01 |
|  3   |     1     |    4   | 2011-06-03 |
|  4   |     2     |    5   | 2011-01-01 |
|  5   |     2     |    6   | 2011-01-01 |
[CATEGORIES]
| CategoryID | Title  |
|      1     | Things |
|      2     |  Bath  |
|      3     | Chairs |
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜