Elxis CMS Forum
Support => General => Topic started by: maple on August 12, 2014, 14:28:44
-
Hi,
I just added up to 20 imatge folders path in the xml file images.engine.xml. I also change some "10" values in the images.engine.php turned to "20". But doesn't work. In which file can I turn 10 value to 20 ?
Perhaps this can increase the time of search results. I have only a very few images into each folder.
Thanks
-
You don't need to modify anything, undo your changes in XML file.
Go to Extensions > Search engines
Click Images search engine to edit it.
On tab Parameters set the option Limit to anything you want between 5 and 50.
Save your settings.
-
Hi datahell, thanks for your response,
misunderstanding, i don't want "Number of items to display per page". Need about 20 folders path containing searchable items. Now I only can do up to 10 folders path.
thanks
-
OK. Then edit the XML file and add 10 more folders in the list with the proper names.
<param type="text" name="dir11" default="" label="FOLDER_PATH" dir="ltr" size="40" description="" />
...
<param type="text" name="dir20" default="" label="FOLDER_PATH" dir="ltr" size="40" description="" />
Then open images.search.php and change line 45 from this:
for ($i = 1; $i < 11; $i++) {
to this:
for ($i = 1; $i < 21; $i++) {
That's all!
-
datahell
thank you! Yes the xml I already did. My problem was on line 45!
A question
What is best performance/quicker to take search results for images:
1 - put 2700 images into 1 folder
2 - put 54 images in 50 folders
3 - too few images to see differences
(at first sight, #2 is best)
Thanks
-
Image search engine uses "glob" php function. By default glob sorts results alphabetically which slows down the process. You can make it faster if you disable sorting (Elxis has custom sorting method) in glob by putting the GLOB_NOSORT flag.
$images = glob("{".$patdirs."}{".$pattype."}", GLOB_BRACE);
$images = glob("{".$patdirs."}{".$pattype."}", GLOB_BRACE | GLOB_NOSORT);
This should speed up search 20-40%.
As for the folders I believe putting them into 1 folder is faster as the function doesn't need to search in multiple paths. You can enable performance monitor in Elxis to see the difference. Make a test with the images in multiple folders and an other test with the images in one folder. The performance monitor will tell which method is faster. Run the tests multiple times and get the average loading time of component search or of the search engine.
If you have too many images you might consider the development of a custom search engine that indexes images and uses cache.