Jump to content
RIkard

I get duplicates in the search results

Recommended Posts

Hi

I'm using the content search pro and when I search i get duplicates in the search results. Is there perhaps a settings somewhere that I have overlooked? I can't find anything in the forum or documentation about this. When I switch back to the original content search I don't get duplicates.

Best regards
Rikard

Share this post


Link to post
Share on other sites

Search Content Pro doesn't produce any duplicates and never did. It simply can't, because search results are grouped by a dozen parameters, including article ID, which is always unique.

Maybe you have 2 content plugins activated at once somehow, maybe something else. Anyway, it's not related to Search Content Pro, this I can guarantee.

Share this post


Link to post
Share on other sites

Hi and thank you

It's very strange that I get the duplicates when I use the content search pro but not when I use the regular search so I investigated further and I found out that is is actually the joomla tags that are bugging. I looked at all my duplicated content, it was 2 articles, when I removed the tags from them and then reassigned the same tags they were no longer duplicated in the search results. Even if this has nothing to do with this plugin I thought it be good to inform you just in case someone else has the same problem.

Best regards,
Rikard

 

 

Share this post


Link to post
Share on other sites

Huh... that's interesting. Probably, tags were previously saved in a wrong way somehow. Still I can't imagine, how did you get duplicates.

I never seen any duplicates myself and it was never ever reported, even when this extension had much simpler query. Current query is so crazy precious, that I don't know, what else to add or fix in it :-) 

Share this post


Link to post
Share on other sites

That's great :D I haven't used it for long but it really do what I want it to so I'm bent to agree with you :)

Share this post


Link to post
Share on other sites

I've got also the problem with the duplicate content in search results. :-(

My investigation shows that it is produced from the user related statements in the select query.

If I change the select query in this way: 

 SELECT a.`id`, a.`alias`, a.`catid`, a.`state`, a.`language`, a.`created`, a.`images`, a.`featured`, CONCAT(a.`introtext`, a.`fulltext`) AS `text`, a.`title`, a.`metadesc`, a.`metakey`, c.`title` AS `category`, c.`alias` AS `catalias`, c.`description`, c.`params`, c.`metadesc` AS `catmetadesc`, c.`metakey` AS `catmetakey`
  FROM sen25_content AS a
  LEFT JOIN sen25_categories AS c
  ON (c.`id` = a.`catid`
  AND c.`access` IN (1,4))
  WHERE ((a.`title` LIKE LOWER(_utf8 '%word%')) OR (a.`introtext` LIKE LOWER(_utf8 '%word%')) OR (a.`fulltext` LIKE LOWER(_utf8 '%word%')))
  AND c.`published` = 1
  AND a.`access` IN (1,4)
  AND a.`state` IN (1)
  AND a.`catid` NOT IN (37,136,97,83,123,125,36,95,96,134,135,52,92,131,84,86,54,46,122,53)
  AND (a.`publish_up` = '0000-00-00 00:00:00' OR a.`publish_up` <= '2017-07-06 09:30:08')
  AND (a.`publish_down` = '0000-00-00 00:00:00' OR a.`publish_down` >= '2017-07-06 09:30:08')
  AND a.`language` IN ('de-DE', '*')
  AND c.`language` IN ('de-DE', '*')
  GROUP BY a.`id`, a.`title`, a.`metadesc`, a.`metakey`, a.`created`, a.`introtext`, a.`fulltext`, c.`title`, a.`alias`, c.`alias`, c.`id`
  ORDER BY c.`title` ASC, a.`title` ASC
  LIMIT 0, 10

everything works fine.

In my opinion, the user related statements are not necessary or the select query has to be corrected.

Another big problem: I have other Search Plugin activated (Virtuemart and Download). If the user is searching only in content area (... &areas[0]=content_all) by clicking the "All articles" option, a blank screen with error (in your sql syntax near ...) is shown.

Could you please check this as soon as possible? Thanks! Besides of these bugs I am pleased by the possibility to exclude articles of certain categories - this works like a charm. :-)

Share this post


Link to post
Share on other sites
1 hour ago, pixelhexe said:

Another big problem: I have other Search Plugin activated (Virtuemart and Download). If the user is searching only in content area (... &areas[0]=content_all) by clicking the "All articles" option, a blank screen with error (in your sql syntax near ...) is shown.

Which error exactly? Copy it here.

 

Share this post


Link to post
Share on other sites

I could reproduce it on another joomla site (newest joomla version 3.7.3), but the error doesn't really help:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) AND c.`published` = 1 AND a.`access` IN (1,5) AND a.`state` IN (1) AND u.`id`' at line 1

MySQL Server-Version: 5.7.9

Share this post


Link to post
Share on other sites
6 minutes ago, pixelhexe said:

I could reproduce it on another joomla site (newest joomla version 3.7.3), but the error doesn't really help:

And how exactly did you do that? Does it require another search plugin to test?

6 minutes ago, pixelhexe said:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) AND c.`published` = 1 AND a.`access` IN (1,5) AND a.`state` IN (1) AND u.`id`' at line 1

It actually does help. It looks like no search data been passed to Search Content Pro and initial WHERE array is empty due to this. Try to move Search Content Pro ABOVE any other search plugin. Some of them might be breaking the search workflow.

Share this post


Link to post
Share on other sites

Hm, no effect unfortunately. I could try to delete the other search plugins on my local system. I will try later and let you know. 

The error is appears after a click on "all articles" ->

searchword=suchwort&ordering=newest&searchphrase=all&areas[0]=content_all

Share this post


Link to post
Share on other sites

So I have checked it again - same result. :-( It makes no difference - also if I uninstall all other search plugins: as soon as I activate the "search area option" in Joomla, so that the user can filter the search results (which makes obviously no sense if I have only one search plugin activated - just for testing) and the user chooses "All articles" for his search, the result page is broken with the above mentioned error message.

search-plugin1.PNGsearch-plugin2.PNG

Share this post


Link to post
Share on other sites

Yeah, there's was a small issue with empty basic WHERE query, if all, featured or archived areas checked. I've fixed it already, you can download a new version. Should be good now.

Share this post


Link to post
Share on other sites

Thank you for the new version - the "all articles" issue is fixed now. :-)

But unfortunately the duplicates in the search results still are not.

Further investigation: articles which are modified by another author than the one who created the article, are shown twice.

As written before the duplicates are produced from the user related statements in the select query,

ON (u.`id` = a.`created_by` OR u.`id` = a.`modified_by`) 

Could you please check this and fix.

 

Share this post


Link to post
Share on other sites
11 minutes ago, pixelhexe said:

As written before the duplicates are produced from the user related statements in the select query,

Nothing to fix, no duplicates. This line is NOT the issue, another one was.

Download again and try. I've re-uploaded extension a few times.

Share this post


Link to post
Share on other sites

It's okay now, thanks.

Although it's not the best idea to change the code without new version number?

Anyway, at least the plugin works now as expected.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment


×