我需要实现产品搜索。每个产品都有名称、类别、价格和 availableAtPlace。我想使用这些参数进行搜索:
- product name - look for specified keywords in product name
- filter those belonging to one of the many selected categories(from fixed 8 categories only, forever)
- filter those within specified price limit.
- filter those available within radius of 'x' miles from spot 'y'
现在我有以下问题:
1. What should be the query to get the search results filtered by above parameters ?
2. Is there any way I could store these categories field in optimized
way(since this is always out of fixed set of 8 values), so that
query performance could be improved ? Probably some way of defining
my set earlier so that indexing/querying of this field could be
optimized!?
3. I need to sort the results in the order of relevance of keyword
search within product names + sorted in descending order of price.
How do I accomplish this sort order?
将 SolrJ 与 Solr 4.5 一起使用