Body: <p>I want to figure out how to change our CRAFT CMS-built website's search functionality to deliver search results in descending chronological order. Currently, the oldest entries are at the top and people often don't scroll to the bottom. This has caused confusion for our organization. Any help would be greatly appreciated.</p>
  <p>Running Craft CMS 3.7.38</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-21T19:52:49.187Z
Comments.Text: Are you talking about a search implemented via code for your website or do you mean the Control Panel search?
Comments.UserDisplayName: Henrik
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-21T19:54:20.313Z
Comments.Text: I mean the search implemented code for the website
Comments.UserDisplayName: Erin 
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-21T20:06:13.207Z
Comments.Text: Can you provide some code how it is implemented? if you have this syntax {% set results = craft.entries().search(searchQuery).orderBy().all() %} ,you can change it then to this: .orderBy('postDate DESC').
Comments.UserDisplayName: Henrik
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-21T20:10:56.227Z
Comments.Text: Unfortunately, I didn't build the code, but am on the CMS side since I just joined the company. Trying to get access to the backend, but is there any shortcut on the CMS side to seeing the implementation? I know this is scope creep, but maybe i can then answer the question
Comments.UserDisplayName: Erin 
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-21T20:14:57.347Z
Comments.Text: to change the order you eventually need full access to the code, so i would guess the safest approach is to get access to the templates. can you get to the template via ftp?
Comments.UserDisplayName: Henrik
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-21T20:23:37.473Z
Comments.Text: Not currently. I am asking so I can go to the gatekeeper of the FTP and the code who says he cant change the search order and say, "You need to do X in order to change the search results." He has been saying that there's no way to change the order of the search results, but I know it's not true.
Comments.UserDisplayName: Erin 
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-21T21:14:51.027Z
Comments.Text: thats a though one. maybe best would be you get familiar on how one can implement a search, different strategies and get well prepared. good luck with the gatekeeper.
Comments.UserDisplayName: Henrik
Tags: <search>
Title: Change search result order?
ThreadText: # Change search result order?
  
  (Asked by: username_0 on 2022-06-21)
  
  I want to figure out how to change our CRAFT CMS-built website's search functionality to deliver search results in descending chronological order. Currently, the oldest entries are at the top and people often don't scroll to the bottom. This has caused confusion for our organization. Any help would be greatly appreciated.
  
  Running Craft CMS 3.7.38
  
  **Tags:** search
  
  > **Comments:**
  > **username_1**: Are you talking about a search implemented via code for your website or do you mean the Control Panel search?  
  > **username_0**: I mean the search implemented code for the website  
  > **username_1**: Can you provide some code how it is implemented? if you have this syntax {% set results = craft.entries().search(searchQuery).orderBy().all() %} ,you can change it then to this: .orderBy('postDate DESC').  
  > **username_0**: Unfortunately, I didn't build the code, but am on the CMS side since I just joined the company. Trying to get access to the backend, but is there any shortcut on the CMS side to seeing the implementation? I know this is scope creep, but maybe i can then answer the question  
  > **username_1**: to change the order you eventually need full access to the code, so i would guess the safest approach is to get access to the templates. can you get to the template via ftp?  
  > **username_0**: Not currently. I am asking so I can go to the gatekeeper of the FTP and the code who says he cant change the search order and say, "You need to do X in order to change the search results." He has been saying that there's no way to change the order of the search results, but I know it's not true.  
  > **username_1**: thats a though one. maybe best would be you get familiar on how one can implement a search, different strategies and get well prepared. good luck with the gatekeeper.  
  
  ---
  
  ## 0 answers
  
  