Tonight I went ahead and officially released searchlogic v2. If you didn’t read my last post, v2 is a complete rewrite of the library. It takes a new approach. It went from ~2300 lines of code to ~400 lines of code. It’s simpler, easier to use, much more light weight, faster, and more importantly, easier to maintain, understand, and improve upon.
I’m not going to ramble about the changes, because you can read my previous post or you can check out the read me on github.
I have decided to start using github to host my gems, if you want to start using v2 as a gem you need to install the binarylogic-searchlogic gem from the github source. (checkout the read me for easy installation instructions).
Sorry for such a quick post. I figured this was an important announcement.
Thank you for being patient with v1, I know there were some people having issues. This should address all of them.
As always, I did my best with the readme and the rdocumentation. If you really want to see what v2 is all about I suggest you take a glance at those, they should be comprehensive.
I hope you enjoy v2, I’m really excited to release it. I have already integrated it into the app that I am working on, and I love it. It works great and all of my tests pass.
Thanks again for the awesome plugin.
Wondering about the people who don’t follow the blog and continue updating the ’searchlogic’ gem. They won’t be aware that it’s 2.0.0 now and is actually called ‘binarylogic-searchlogic’.
GitHub’s prefix on gems annoys me.
Thanks, this looks like a great direction for the project. I do have a couple of questions, though.
Do you have a link to the documentation for the 1.6 version? Many of us are still using it, and it will take some time to upgrade and test everything.
Speaking of upgrading, are you planning on releasing an upgrade guide? Given that v2 is so different, a guide or blog article would be extremely valuable for those of us using v1.6.
Yes, nice plugin!
Documentation of controllers are very good! I have just some doubts about template part, helpers like connections with variables, ordering and pagination. A simple example can help too.
[]s
Ho oleg, I plan to release another version on rubyforge with a post install message informing everyone of this. It’s just a lot easier for me to do it this way. To be honest, rubyforge is started to get outdated. Hosting on github allows people to fork the project, and even use their own forks as gems. It just seems to make more sense for open source.
John, yes I will try to write something up. The concept behind searchlogic is pretty simple, so the transition should be simple as well. There are a few gotchas and I’ll try to write something up covering those. I’ll see what I can do to get the older documentation up.
[...] Searchlogic v2 officially released – Dynamic named scopes and search support by magic. A Fresh Cup is Mike Gunderloy’s software development weblog, covering Ruby on Rails and whatever else I find interesting in the universe of software. I’m a full-time Rails developer and contributor, available for long- or short-term consulting, with solid experience in working as part of a distributed team. If you’d like to hire me, drop me a line. Links [...]
Hi Ben,
excellent work on v2. I’ve been using v1 and like it a lot.
One question, though: I loved how easy it was to integrate all sorting, searching and pagination with searchlogic v1. Now that pagination is out of v2, how does it all fit together? The helpers were nice (they kept all the necessary state to make it transparent).
Thanks a lot!
nachokb
Hey just wondering if the conditions.group functionality is going to be available in the V2 release at some point? Or is already with different syntax from V1?
Great plugin thanks.
hey, 2.0 is a GREAT release.
i do have one question. i have tried everything to activate the ‘OR’ between conditions instead of AND.
(e.g. name LIKE ‘%dude%’ OR address LIKE ‘%dude%’ )
wondering what the trick is.
Thanks and great work! i have completely removed ferret from all my projects. i sleep better at night, lost 15 lbs, and im pretty sure my hair is re-growing after switching to searchlogic!
just saw your response about this in the beta thread. will roll my own solution in the interim. thanks!
I need to incorporate a calculated field into my objects collection and then, of course, make that field available to searchlogic for searching, sorting, pagination, etc. Does anyone know if this is possible? Thanks!
As Josh and Jerrod I’m looking for group-support and ways to do a grouped “or”-search (”or” inside a group, groups are “and” combined).
Example
——-
Search Query: “123 M”
Searches for:
(name like “%123%” OR ordernumber like “%123%”) AND
(name like “%M%” OR ordernumber like “%M%”)
I think this is not an edge-case, its basic functionality many people would expect from a complete search solution.
Thanks for this Ben. I was able to do advanced search in no time..
Falk, I agree with you. The goal of v2 was to not recreate the wheel so much and work with ActiveRecord instead of against it, which is why v2 is about 1/5 the size of v1. Anyways, v2 leverages named scopes, this has many advantages that I won’t go into. But the problem is that chaining named scopes uses “AND”, which is done in the AR internals. Using “or” significantly complicates things, because then you need to group conditions, etc. The order of the conditions is a lot more important and ruby’s params uses an unordered hash. This presents a big problem.
What I’ve been doing is just creating my own named scopes for these scenarios. I could probably create another module in searchlogic to handle “or” but right now I don’t have the time. If you want to create a new module called “Or” in the NamedScopes name space go for it. Give it a shot, you could leverage a lot of what already is going on in searchlogic, in the same manner that the associations module does. I’ll add this to the list, but I can’t guarantee it will get done in the next couple of weeks. Sorry.