jDownloads Support Forum

Older Versions => jDownloads 3.2 (Support ended) => Topic started by: etolosa on 27.09.2017 23:24:30

Title: Search on categories description
Post by: etolosa on 27.09.2017 23:24:30
Is it possible to search into categories description ?
What files do i have to modify in the code to include the search on the categories table?
Title: Re: Search on categories description
Post by: ColinM on 29.09.2017 00:32:50
Hi
Reget that at this time the category descriptions are not included in the search.
Could you add into suggestions please
Thanks
Colin
Title: Re: Search on categories description
Post by: etolosa on 29.09.2017 01:22:26
Hi, i have seen this query:

SELECT a.file_title AS title, a.metadesc, a.metakey, a.url_download, a.extern_file, a.other_file_id, a.license_agree, a.password, a.author, a.date_added AS created, a.language, a.custom_field_6, a.custom_field_7, a.custom_field_8, a.custom_field_9, a.custom_field_10,CONCAT(a.description,a.description_long,a.changelog,a.custom_field_13,a.custom_field_14) AS text,CASE c.title WHEN 'root' THEN 'Sin Categorizar' ELSE c.title END AS section, CASE WHEN CHAR_LENGTH(a.file_alias) THEN CONCAT_WS(':', a.file_id, a.file_alias) ELSE a.file_id END as slug, CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(':', c.id, c.alias) ELSE c.id END as catslug, '2' AS browsernav FROM #__jdownloads_files AS a INNER JOIN #__jdownloads_categories AS c ON c.id = a.cat_id WHERE ((a.file_title LIKE '%word%' OR a.description LIKE '%word%' OR a.description_long LIKE '%word%' OR a.changelog LIKE '%word%' OR a.author LIKE '%word%' OR a.metakey LIKE '%word%' OR a.metadesc LIKE '%word%'))AND a.published = 1 AND c.published = 1 AND a.access IN (1,1,2,7) AND c.access IN (1,1,2,7) AND (a.publish_from = '0000-00-00 00:00:00' OR a.publish_from <= '2017-09-28 23:18:53') AND (a.publish_to = '0000-00-00 00:00:00' OR a.publish_to >= '2017-09-28 23:18:53') GROUP BY a.file_id, a.file_title, a.metadesc, a.metakey, a.author, a.date_added, a.description, a.description_long, a.changelog, a.custom_field_6, a.custom_field_7, a.custom_field_8, a.custom_field_9, a.custom_field_10, a.custom_field_13, a.custom_field_14, c.title, a.file_alias, c.alias, c.id ORDER BY a.date_added DESC

which is the deault query to search the word "word".

I think it is possible to include the sentence

OR c.description LIKE '%word%'

in the sql sentence in this file
/com_jdownloads/models/search.php

It seems the resultant query works ok in phpmyadmin, but there should be a filter to results.

What do you think ?



Title: Re: Search on categories description
Post by: ColinM on 29.09.2017 18:17:10
Hi
At the present time the existing code does not include the search of the Category descriptions.  It is obviously possible to do but it needs a change of code.  That is why I proposed you add it in as a suggestion. We are working on a new major version.
Colin
Title: Re: Search on categories description
Post by: linkedla on 24.06.2019 17:24:11
Hello, how can I do to get the categories in the search result instead of the file list?
All my categories have the name of the product images on it, in some cases the product have 8 or 12 images so the results are long and I need people to be able to download the whole set of images, so if they get the results as categories it will make easier the next click, check, continue, download.
Thank you for your help.
Title: Re: Search on categories description
Post by: ColinM on 25.06.2019 10:56:24
Hi
Not sure I quite understand :(
Just for clarity a Download consists of title  and may include description, previews,  example images, and so on and usually a downloadable file.  The Categories info includes the directories in which the downloadable files are stored.
Think you are asking if you can download all the downloadable files in the Downloads in a Category.  That can be done by using one of the Files layouts with check boxes so the user can tick which ones they want.
Alternatively you could construct a Download with a zip file that has all the files in it.  You could use example images in the Download to illustrate the contents.
Colin
Title: Re: Search on categories description
Post by: linkedla on 27.06.2019 18:30:36
Hello, Thank you for your answer, what I need is to display is a list of the categories by name that coincide with a search term, this way people can go to the category and check the download all files in this category.
Currently the search display the list of files by name, no category list.