Ordering the Search Results

This topic contains 4 replies, has 3 voices, and was last updated by  Paolo 9 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #113590

    squashed_pixel
    Buyer
    Post count: 26

    Hey

    Im just wondering if its possible to force the search results a specific way.

    Basically I want the search results to order by ‘Featured’ first, rather than by distance. I know this may affect the results shown.

    I have set featured to show first on the normal listing pages by going to Geodirectoy->place settings and adding the featured to the filters, that is all working perfectly.

    I just need to force the search results to do the same thing now?

    Cheers

    Ben

    #113598

    mb
    Buyer
    Post count: 151

    Hi,

    This is something I am also interested in. I would imagine it in the perfect way for my project as follows:

    First are coming only featured listings arranged by distance and then the normal listings arranged by distance.

    Would it be a smart way to change the query (custom job if it is necessary) or it will slow down outputting the search results too much?

    Best,
    Milena

    #113800

    Paolo
    Site Admin
    Post count: 31211

    Hi,

    this is not possible, it would require 2 separate queries and would slow down the page loading too much.

    Please read here for more: https://wpgeodirectory.com/support/topic/sort-not-working/#post-112947

    Thanks

    #134265

    mb
    Buyer
    Post count: 151

    Hi paolo,

    just playing around with some thoughts. Please comment on this if you have time.

    So, first when searching via distance, the query’s most important parameter is the distance, and it is sorting out the results in an array with the closest listing first, etc., etc. Then this array is displayed as the search results. If we need to put the condition featured too then we have to create this second query to re-filter and rearrange the results and slowing down the performance. Am I following correct here?

    What if when searching by distance we save the results in 2 arrays with a condition like this:
    if distance + featured => save in array 1
    if distance + non-featured => save in array 2
    Display first results array 1, then display results array 2

    Is this possible? If yes, would that skip the second query or harm the performance?

    Curious about your comments. Thanks.

    #134543

    Paolo
    Site Admin
    Post count: 31211

    Hi,

    that would still require twice the queries. (and it would serve confusing results)

    Thanks

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount