Adult Script Pro Community Forums

The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!

You are not logged in.

#1 2015-07-31 12:44:22

discuss4u
Member
Registered: 2013-03-06
Posts: 163

[FIXED IN 2.0.9] Bug of search

I am using Sphinx for search.

In user frontend, it seems that videos that are not approved yet can still be searched. Yet, it returns 404 when trying to click into the unapproved videos.

Please check.

Offline

#2 2015-08-01 03:44:55

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [FIXED IN 2.0.9] Bug of search

This should not be possible, because only videos with status 1 will be indexed by sphinx.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#3 2015-08-01 12:04:49

discuss4u
Member
Registered: 2013-03-06
Posts: 163

Re: [FIXED IN 2.0.9] Bug of search

Well, it is really strange.

I have checked the database, the videos are of status 2.

And I also check sphinx.conf. As you said, it should only index status 1 videos. I see that there is a WHERE clause "v.status = 1"

But these status 2 videos can still be searched in user frontend.

I am sure that this only happens after I upgrade from 1.2.3 to 2.0.6.

I have check my both sites and the same thing happens. So please help to check it.

Last edited by discuss4u (2015-08-01 12:06:45)

Offline

#4 2015-08-02 21:32:39

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [FIXED IN 2.0.9] Bug of search

Sphinx is enabled in Admin?


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#5 2015-08-03 09:41:19

discuss4u
Member
Registered: 2013-03-06
Posts: 163

Re: [FIXED IN 2.0.9] Bug of search

Yes, in video::config::search setting, search type is set to complex (sphinx) with these setting in admin::configuration

Sphinx Host: Localhost
Sphinx Port: 9312
Sphinx index: videos

In fact, i didn't change these settings since 1.2.x.

Thanks

Offline

#6 2015-08-04 03:08:49

discuss4u
Member
Registered: 2013-03-06
Posts: 163

Re: [FIXED IN 2.0.9] Bug of search

I have digged into the problem a bit.

I tried to update sphinx index manually after a video is uploaded.

I update sphinx index when video status = 2, the video COULD BE search.

I digged into the sphinx.conf file again and find that changing

    sql_query           = \
        SELECT v.video_id, v.title, v.description, v.mobile, v.add_time, \
         v.rating, v.total_views, v.duration, v.video_id AS video, \ #added in RC4
         GROUP_CONCAT(DISTINCT t.name SEPARATOR ' ') AS tags \
        FROM video AS v \
        LEFT JOIN video_tags AS t ON (t.video_id = v.video_id) \
        AND v.status = 1 \
        GROUP BY v.video_id

to

    sql_query           = \
        SELECT v.video_id, v.title, v.description, v.mobile, v.add_time, \
         v.rating, v.total_views, v.duration, v.video_id AS video, \ #added in RC4
         GROUP_CONCAT(DISTINCT t.name SEPARATOR ' ') AS tags \
        FROM video AS v \
        LEFT JOIN video_tags AS t ON (t.video_id = v.video_id) \
        WHERE v.status = 1 \
        GROUP BY v.video_id

will solve the problem.

Seems that because using "AND v.status=1" may not filter out the row with other status.
So, using "WHERE v.status=1" is a better option

Last edited by discuss4u (2015-08-04 03:56:17)

Offline

#7 2015-08-04 13:08:30

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [FIXED IN 2.0.9] Bug of search

Hmm...it should not work with AND. Sphinx should report a error when indexing :-(


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#8 2015-08-04 13:27:16

discuss4u
Member
Registered: 2013-03-06
Posts: 163

Re: [FIXED IN 2.0.9] Bug of search

Well, I have tested the SELECT statement in other sql management program and there was no error when using AND. The only thing is that it will show all videos no matter what the video "status" is.

I will suggest making changes to this thread http://forum.adultscriptpro.com/viewtopic.php?id=160 so as to correct the issue.

Offline

#9 2015-10-26 08:12:24

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [FIXED IN 2.0.9] Bug of search

Fixed in the documentation also.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

Board footer

Powered by FluxBB