Projection Filter Groups (And / Or)

Topics: General
Jul 2, 2012 at 4:39 PM

Filter Groups are treated like Or filters in Projector right?

I've set up a query where my first filter group works fine, but when I add a new group to filter on just a single input field in my content type '{Request.QueryString:mlsnumber}', I get no results.

Also wondering how to make a query filter optional without having to rewrite every possible search scenario (which currently doesn't work with just the two I'm dealing with now). Since I'm working on a real estate site, there's a ton of fields and selects I'd like to allow users to sort and filter with whatever combination of facets they like (within reason & logic).

And finally, I posted a question about filtering on Taxonomy Terms over here: http://orchardtaxonomies.codeplex.com/discussions/361473 , not sure where the best place to ask since it's dealing with both taxonomies and projections.

Thanks!
JV

 

Jul 2, 2012 at 6:46 PM

To work around this issue I've had to create a separate query and projection instead of groups... Should I file a bug or is this by design?

When a client leaves the MLS field blank they can select ranges for beds, baths, and price and get passed to ~/listings/search?bedmin=3&bedmax=4&bathmin=2&bathmax=4&pricemin=250000&pricemax=450000

And if a client enters just a a value in the mls search field they now get passed to ~/listings/search-mls?mls=10048899 which is not ideal but seems to be the only way I can pull results properly.

I'm sure all these issues will be sorted eventually so it doesn't make me any less stoked on Orchard.Projections... It seems like it's becoming Orchard's own take on SOLR, which is pretty freakin awesome!

Coordinator
Jul 3, 2012 at 1:20 AM

This was fixed in 1.5 (which is not out yet): http://orchard.codeplex.com/workitem/18757

Developer
Jul 3, 2012 at 11:46 AM

With a filter of that complexity I'd write a custom filter provider. I recently wrote a filter for a less complex scenario, but with similar requirements (many optional parameters, OR-expressions). I still think it's the better option than trying to build it from the admin UI. Also this way making changes is just code change, you don't have to execute some multiple step configuration change in production.

Jul 3, 2012 at 1:32 PM

I agree that's a filter provider is probably better but you can also export and import the query filters from local to test, live,etc.

Jul 3, 2012 at 7:24 PM

Thanks guys!

I'm having a real hard time understanding much beyond the Views part of MVC, I get the general gist of Models, but still don't understand enough of the juicy bits to write any real functionality. So can anyone recommend some MUST HAVE resources to get me on track to becoming a .NET developer instead of just a website designer?

As for writing a custom filter provider, I wouldn't even know where to start... but I'm chomping at the bit to figure it out ;)

Since the real estate site I'm working on is for a friend, and gets very little traffic, I published it last night: http://ktowneric.com it's responsive so you can check it on your smartphone or tablet, but it still needs some optimizing. Any feedback would be warmly welcomed!

Thanks again!