Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Priority on ORDER BY Field in search engines

 

 


Djulia
User

Jan 17, 2012, 11:27 AM

Post #1 of 3 (258 views)
Shortcut
Priority on ORDER BY Field in search engines Can't Post

Hi,

I have two fields on which I make a search (title,content_query).
I would like to give a priority in the results to the first field (title) if the word that I search is in the title.
I tested ORDER BY Field(title,'High'), but that does not function.

Does somebody have another suggestion?

Thanks!

Djulia



(This post was edited by Djulia on Jan 21, 2012, 2:18 AM)


Jason
Staff / Moderator


Jan 18, 2012, 10:05 AM

Post #2 of 3 (247 views)
Shortcut
Re: [Djulia] Priority on ORDER BY Field in search engines [In reply to] Can't Post

Hi,

You could try something like this in the orderBy option:


Code
 
'orderBy' => "(NOT (title LIKE '%".mysql_escape(@$_REQUEST['title,content_query'])."%'))",


Hope this helps
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 


Djulia
User

Jan 20, 2012, 6:48 AM

Post #3 of 3 (239 views)
Shortcut
Re: [Jason] Priority on ORDER BY Field in search engines [In reply to] Can't Post

Hi Jason,

It is perfect! Thanks! :)

Djulia