martin-magakian / Amazing-Cloud-Search

Allow you to search, faceted search, add, update, remove objects from your Amazon Cloud Search Index in C#.
30 stars 17 forks source link

adding order by functionality #4

Closed radavies closed 10 years ago

radavies commented 10 years ago

Hi Martin/Brandon,

As promised here is the order by functionality added.

It shouldn't break anything you have already as it's ignored if you don't supply an order by field as you can see, it's pretty fool proof to use.

I've tested it with my project using a live CloudSearch domain and it's working well, I just do:

SearchQuery searchQuery = new SearchQuery { BooleanQuery = query, Facets = facets ... OrderByField = "whatever_you_like", OrderByAsc = true/false};

Hopefully you'll be able to accept this into the main project and eventually it'll make it back onto NuGet. I've removed the NuGet reference in my project for now to use this version but once it becomes available I'll start using the NuGet version again for sure.

Cheers for the help yesterday too by the way.

Thanks,

Raymond

martin-magakian commented 10 years ago

Nice work. I will try it soon.

Can you write a quick note in the documentation about OrderBy? Also can write some unit test?

radavies commented 10 years ago

Hi again,

I've updated the readme and added a few tests that make sure the URL contains or doesn't contain the rank parameter under the different condition and also that it is ranking in the correct direction (ASC/DESC) which is all working correctly.

I'm having a little trouble with the checking the call was/wasn't made test though. I've never used that stuff before and am getting an exception "StructureMap Exception Code: 202 No Default Instance defined for PluginFamily String" and I'm not sure how to proceed. The test I was attempting is in the same file but commented out for reference.

Thanks

martin-magakian commented 10 years ago

Hi Raymond, Thanks again for your commit. It been review validate and merge in the master branch.

If you fell like adding anything else in the future it will be more than welcome.

radavies commented 10 years ago

Brilliant thanks, out of interest when do you think the 3 pull requests added recently will be available via NuGet? Myself and my coworker, AutoGibbon, will download the new version as soon as it's available :)

martin-magakian commented 10 years ago

I don't know yet. I sent an email to DovetailSoftware as they have some nice work to merge. They are the one who maintain the NuGet repo. So it mainly depend on them.