zenphoto forums » General Zenphoto Discussion

printRelatedItems relevance

(2 posts)

No tags yet.

  1. kilroy

    Member
    Joined: Oct '10
    Posts: 29

    I am trying to use printRelatedItems on an image page, to display similar images.

    I find it very difficult to display relevant images. The more tags there are, the less relevant the results (which is the contrary of what we would expect)

    I think this is due to this part of the code

    foreach ($tags as $tag) {
    $count++;
    if ($count ==1) {
    $bool = '';
    } else {
    $bool = '|'; // connect tags by OR to get a wide range
    }

    In order to get relevant results, we should only connect tags by OR if there are three tags or less.

    I tested this and it seems to give better relevance


    foreach ($tags as $tag) {
    $count++;
    if ($count <3) {
    $bool = '|';
    } else {
    $bool = ''; // narrow the search to relevant tags
    }

    Do you think you could change this in the plugin?

    Another problem is that the search results tend to always be displayed in the same order. So if you use rather generic tags on lots of images, you end up with the same array of images displayed every time.
    Would there be a way to randomize the order of search results?

    Anyway, trying this made me realize I had a lot of work to do on tagging, especially if I want to link the images based on common topics.

    Posted 2 months ago #
  2. Zenphoto development team
    acrylian

    Zenphoto team
    Joined: Jul '07
    Posts: 16,769

    Results seem to look fine on our own site to me. But we don't use loads of tags and this primarily for news articles (technically the same). So we are open to improvements. Feel free to open a ticket or pull request for the change.

    The order of search results in general can be set via options. Additionally you can use the object model to do this directly via your theme, too. I don't think that general randomizing is of general use as you want a kind of relevance normally.

    Don't forget to read the Forum rules and usage resources
    Posted 2 months ago #

RSS feed for this topic

Reply

You must log in to post.