We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28076
    • 1 Posts
    I have a DVD trailer application designed in Modx - list movies by category and each movie has title, genre, actors and directors and a summary. When I use the search function for say "Bank Job" it searches all the fields and obviuously bank and job appear in the summaries of many movies so the actual title appears on the last page of results. How do I give preference to the title, then only after that the summary?
    ModX Newbie...
      • 5811
      • 1,717 Posts
      With version 1.8.1 - Use the whereSearch parameter to specify in which fields you would like search your data. See AS wiki documentation.

      by default &whereSearch=`content|tv` which means that the data are searched in :pagetitle,longtitle,description,alias,introtext,menutitle,content of the document and in tv_value of each tv linked to the documents.

      For instance to limit the search to pagetitle and longtitle of documents only, writes &whereSearch=`content:pagetitle,longtitle`

      You could also search in all the fields but define the ranking of results with the rank parameter.

      for instance &rank=`pagetitle:100,longtitle:10,extract`. In this example, a term found in pagetitle give a result weight of 100, 10 in longtitle and 1 in extract (you could also define the extract. By default= 1:content,description,introtext,tv_content).