質問

I need to develop a system where different kind of "content blocks" are displayed. First I have three systems delivering blocks of data (one of them is a blog, another one a listing of events, a third one something custom). This might get extended later on in the project.

The idea is to have a long list, ordered at first on published date (so chronologically). However, some types might have a little bit more priority, so for example events are showed relatively higher in the list than blog posts with a factor x.

Then I need some additional sorting, like blog articles might be "featured" so they are also given a bit more priority, say a factor y. The last thing is content blocks might be marked "sticky" so they keep at the top of the list all the time.

Because of the advanced technology behind solr and all the query options, I was thinking to use solr as an engine for this listing of blocks. Is something like that possible, or is another technology more suitable for this?

My preference for solr is also because it would be relatively easy to inject new content into the index. But how I have to define a query to return the complete (paginated) index sorted by date is something I have to figure out as well.

As a last point: the application will be a php (Zend Framework 2) project so preferable it must work directly with php or by a client written for php (eg, SolrClient for solr). To formulate it as a question: what might be a good technology for above described requirements and is solr a good one for this?

役に立ちましたか?

解決

Have a string type field named doctype which can take values blog, event and anything in future.


&bq=cat:electronics^5.0
&bq=sponsored:true
&bq=doctype:blog^5.0

Which means the score of documents of field doctype and value blog gets boosted. The 5.0 is boost weight, useful when one condition is more important than another. Adapted from this http://wiki.apache.org/solr/ExtendedDisMax#Examples


And from http://wiki.apache.org/solr/SolrRelevancyFAQ see 11.1 for promoting content to the top; and 12 for boosting according to values of something.


And use asynchronous HTTP calls if you want to make multiple queries to render a single page. If you make 3 queries each of 333ms one after another, your page will take a second to load. But with 3 asynchronous queries, it will be more like 340ms. But it may be tough in PHP!

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top