Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Custom Filter and Document View modes: 
User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 6/14/2012 12:45:51 PM
   
Custom Filter and Document
I've created a custom filter and it works great although I need to set the OrderBy on the DocumentType that I created. The problem I'm having is the filter gathers data from a webservice and then sets the WhereCondition in code but when it comes to sorting the results the field I need to sort by is not available in the Document Type because it changes with each search.

For instance, the document type I created is MyLocations which has a number of attributes (name, address, city, state, etc). These documents are deleted and reimported into Kentico using the Scheduler and a custom module once per day. At when the user goes to search for a location and enters a city, selects a state and selects a distance away (10 miles, 20 miles, etc) they are returned with results. I have web services that determine how far a location is from that city and state they have entered but need to sort by that distance (shortest first) and show the distance on the page.

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 6/22/2012 7:08:04 AM
   
RE:Custom Filter and Document
Hi,

This scenario is quite specific, so I may not see some details from the outer look.
You will need to either store the calculated distance to the documents, or you may need to process the search result dataset and reorder it according to your webservice.
I can imagine this would made the search really slow...

Could you please describe if you have tried for instance to compose the search condition manually or so? Have you tried to put the Sort parameter to the search?

Thank you in advance for information.
Regards,
Zdenek