Sunspot is a great way of integrating Solr search in your Ruby on Rails application. By default searches are performed using the AND operator. For getting results for one of the (multiple) keywords searched for in stead of just an exact match, the operator has to be changed to OR. The most obvious solution would be to change the solrQueryParser defaultOperator in Solr’s schema.xml, but that doesn’t work…
This problem can be solved by passing a minimum_match parameter on your search, shown as followed:
def search
@search = MyModel.search() do
keywords(params[:query]) { minimum_match 1 }
end
end
Setting this up will require only a single keyword to match, so you get the results as a true OR query!
Thanks a lot to Tony on his blog Tonycode.com
Rethinking the Mobile Web by Yiibu
Interesting presentation with facts and figures about mobile internet usage.
Posted by Bryan Rieger on Slideshare.
“Be An Executioner”
Read it on the 37signals website
Did you know, Tribemonitor:
- Currently contains 10.417.024 unique data points (for example, the total number of friends on a given day);
- Tracks 2.576 individual artists with a total of 22.540 configured data sources (for example a Facebook or Twitter account);
- Does approximately 240.000 Twitter API requests every night;
- Retrieves geo-information of approximately 1.2 million users every night;
- Is completely written in Python, C and Django;
- Uses PostgreSQL for data storage and uses memcached for caching;
- Will soon be updated to a “Version #2” based on an Non-SQL database.
In the following snippet, a small, simple but fast implementation of a chat server is given.
It’s created in Ruby and uses websockets to communicate between clients and MongoDB to write the data to the database.
To test it; use the attached simple HTML snippet… The HTML part doesn’t completely work as it should, so don’t use it in production!
The code is a bit of self-explaining really, if you need help; give us a shout at snippets@codigy.nl
We’re currently busy creating an amazing iPhone app for this hot and upcoming Techno-DJ
Codigy
| E-Mail: | info@codigy.nl |
| Tel: | 050-7676063 |
| Twitter: | @codigy |
| Hoge der A 12 |
| 9712AC Groningen |
| The Netherlands |