Explore
Topics
Recent Comments
- I had checked, and tested a lot of time. It work well and flexible on IE, FF, and Chrome *But, in Chrome...
Phong Tran
- hi! i am working with cascades and i would like to use a hands detector and apply a kalman filter to follow...
rachel
- Hi Cary, Cool work, I would like to get the XML file and codes can you email to me please at sheryzo@gmail.com....
Sha
- I had checked, and tested a lot of time. It work well and flexible on IE, FF, and Chrome *But, in Chrome...
Related Posts
Follow us on TwitterWe also post updates and blog posts over on our twitter account. Have one? Follow us!
Advanced db_free_solr
The out-of-box functionality that db_free_solr provides, much the same as acts_as_solr, is designed to make things as easy as possible for you. To that end, the default behavior is to index and store every field you call out in your models. The truth, though, is that you won’t need every field you index to be returned with the results. Likewise, some of the fields you want to have returned will, no doubt, not be necessary to index for searching purposes.
So, how do we go about avoiding unnecessary indexing and storing?
The answer is actually simpler than you might think. Acts_as_solr allows you to specify the datatypes of the fields you tell it to index (if not specified, the index assumes a datatype of text). Like so:
So, what I’ve done, is to add a few datatypes to correspond with the newly available indexing options. As I said above, the default is to both index and store, so what I’ve added are datatypes to indicate that a field should be marked for storage only (“_so”) or indexing only (“_io”). These can be used like so:
It’s also worth noting that you can specify datatypes for each and every field, or only a select few. In other words, this will work just fine:
Here’s a complete listing of the supported datatypes:
That’s all for now. Happy Programming!