Advanced coding advice. I need to program a search that takes the users selection of importance into account. RRS feed

  • Question

  • Thank you for your time, I've searched Google for 'search criteria importance selector code' but couldn't find anything. Does anyone know where I can ask for coding advice?

    The user will select how important the house having will a pool will be. 1 for not at all and 5 absolutely. I will have to sort the results according to these importance selections.

    Wednesday, June 30, 2010 12:35 AM

All replies

  • Any sort will require a list of things to sort on, arranged in order of importance.

    So if the user selected sort  criteria of Banana 3 Apple 2 Pear 5 Melon 1 then the sort order might be "sort on Pear, Banana, Apple".

    From this we can see that just sorting the list of sort criteria in descending order of priority and excluding any marked as priority 1 would ostensibly do the job.  The question I would ask ( as a developer ) of the guy handing me this task is:  "What about when the priority ties?". 

    It would be a lot easier if they picked a list of significant criteria and organised them somehow so they were in highest priority to lowest.

    What if some joker sets everything to 5?



    Wednesday, June 30, 2010 1:05 PM