The more simple and if you use logstash or ingest is adding a weight field depends on the folder so let's say course have 2 points gallery have 1 etc... so you can sort on this field or mix with other fields to sort on.
But you need to reindex your data to set the weight.
Can you provide two sample documents (one with and one without the course folder) and your query?
I'd assume you could build this with a should clause on the course folder in addition to a must for the search term, but it will be much easier if we don't have to guess your current document and query structure.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.