Search Bug

This is the place to discuss bugs that have been found in the most recent version of PivotX. Posting bugs will ensure that the Development Team is aware of them and that they will be addressed when resources are available.

Search Bug

Postby holstray » Tue May 26, 2009 11:20 am

I think I have stumbled upon a bug in the search engine. Some words that are clearly in article texts and titles, cannot be found by the search engine.

I’m using MySQL for the database and have a phpinfo(); online. If one of the developers wants to have a look, I will PM them the links/passwords.

Regards,

Raymond
holstray
 
Posts: 14
Joined: Sun May 24, 2009 9:00 am

Re: Search Bug

Postby Bob » Tue May 26, 2009 6:53 pm

What words? What version of pivotx are you running? Does it matter if these words are in the title, introduction or body?

Two common reasons why MySQL can't find words:
- If the word is too short. By default mysql indexes only words that are four letters or longer.
- Words found in 50% of the entries/pages are ignored by MySQL. So, if the word is too common it won't be found at all.
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm

Re: Search Bug

Postby holstray » Tue May 26, 2009 7:11 pm

I was looking for (indeed) 3 letter words which are in the title, the body and the introduction. So what you are saying is that PivotX cannot find a post by the (Dutch) word "ijs" anymore?

Regards,

Raymond
holstray
 
Posts: 14
Joined: Sun May 24, 2009 9:00 am

Re: Search Bug

Postby Bob » Tue May 26, 2009 8:08 pm

PivotX can, but Mysql doesn't by default. Ask your system's administrator to set the minimum word length in mysql.ini to 3: http://dev.mysql.com/doc/refman/5.0/en/ ... uning.html
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm

Re: Search Bug

Postby howard1969 » Wed Jul 08, 2009 1:01 pm

holstray wrote:I think I have stumbled upon a bug in the search engine. Some words that are clearly in article texts and titles, cannot be found by the search engine.

I’m using MySQL for the database and have a phpinfo(); online. If one of the developers wants to have a look, I will PM them the links/passwords.

Regards,

Raymond


Dear Bob, or anyone who can help...

I have a similar problem. Words are found in pages but not in articles. Any idea?

Many thanks

Howard
howard1969
 
Posts: 1
Joined: Wed Jul 08, 2009 12:52 pm

Re: Search Bug

Postby Bob » Wed Jul 15, 2009 9:01 am

This means the DB is missing the correct fulltext index. The easiest way to fix this is:

- Go to 'administration' > 'advanced configuration'
- Set the 'db_version' to '3' (without the quotes)
- Go to the dashboard.
- Refresh the page a few times, until the warnings go away.
- Try again.

It should be solved now.
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm

Re: Search Bug

Postby Schop » Tue Sep 22, 2009 11:50 pm

Hmm, I seem to have this issue as well. Let me explain:

At first, I noticed that I could find words in pages, but not entries (even words that are only used once on the whole website, so it couldn't be the MySQL thing, where it wouldn't find words that are in > 50% of the entries).

After searching this forum, I changed db_version to '3', like you said. I got some warnings on the dashboard, refreshed and tried searching again. Now I can't even find words on pages anymore. Whatever I type in the searchbox, it never finds any results.

Much to my surprise, the db_version was back at '5' when I checked the advanced configuration. To make sure I wasn't stupid, I tried it again, but with the same result. So I guess I'm not stupid ;)

I'm running PivotX - 2.1.0: SVN - Pre-alpha with MySQL.
User avatar
Schop
Contributor
 
Posts: 485
Joined: Mon Apr 21, 2008 1:47 pm
Location: Hudson, Ohio

Re: Search Bug

Postby hansfn » Wed Sep 23, 2009 6:46 am

I got some warnings on the dashboard

It would have helped a lot to see those warnings. Maybe the updating of the database was blocked (because the db user you have given to PivotX don't have permission to alter the tables)? You could turn on debugging (and add "log_queries" with value 1 in the advanced config) to see what SQL queries PivotX tries to execute and possibly which queries fail.

Much to my surprise, the db_version was back at '5' when I checked the advanced configuration.

Of course it is. That is the whole purpose - you are setting it back to 3 so the database upgrade function is run again (updating the database to version 5). Did you expect it to stick at version 3?
hansfn
Developer
 
Posts: 3281
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Search Bug

Postby Schop » Wed Sep 23, 2009 12:34 pm

After setting the db_version to '3', I get the following errors on the dashboard:

Code: Select all

There was a problem with the Database:

error code 1061: Duplicate key name 'target_uid'

    * If you're in the process of setting up PivotX, you should review your Database connection settings.
    * If it worked before, you should check if the Mysql database engine is still running on the server (or ask your systems administrator to check for you).

      There was a problem with the Database:

      error code 1061: Duplicate key name 'entry_uid'
          o If you're in the process of setting up PivotX, you should review your Database connection settings.
          o If it worked before, you should check if the Mysql database engine is still running on the server (or ask your systems administrator to check for you).

            There was a problem with the Database:

            error code 1061: Duplicate key name 'date'
                + If you're in the process of setting up PivotX, you should review your Database connection settings.
                + If it worked before, you should check if the Mysql database engine is still running on the server (or ask your systems administrator to check for you).


Looking at these messages,it doesn't look too frightening, does it?

By the way, I did expect 'db_version' to stay at '3', because I have absolutely no clue what this does (and it has never been explained in the forum or the documentation either.

The debug log says:
Code: Select all
2009-09-23 08:30:28 - 0.063 -- modules/module_search.php:861 / getWordSql() --  ( 6500268 )
Your search provided no results. Either your term is really not present, or your search term is in the list of MySQL stop words, which are ignored by default
2009-09-23 08:30:28 - 0.067 -- modules/module_smarty.php:2172 / _smarty_link_entry() --  ( 6521016 )
Can't create entry link since uid isn't set.
2009-09-23 08:30:28 - 0.122 -- modules/module_smarty.php:4124 / pivotx_cache_handler() --  ( 6669564 )
write cache: windmill/search_template.html, tpl_3ed663f200
read cache: windmill/search_template.html, tpl_3ed663f200
2009-09-23 08:30:28 - 0.125 -- modules/module_debug.php:230 / debug_printr() --  ( 6667204 )
Array
(
    [0] => SELECT * FROM pivotx_categories AS c WHERE target_uid IN ('6', '5') -- entries_sql.php - read_entries():689  -- 0 sec.
    [1] => SELECT * FROM pivotx_chapters ORDER BY sortorder; -- pages_sql.php - getIndex():70  -- 0.001 sec.
    [2] => SELECT * FROM pivotx_extrafields AS e WHERE contenttype='entry' AND target_uid IN ('6', '5') -- entries_sql.php - read_entries():712  -- 0.001 sec.
    [3] => SELECT COUNT('uid') AS count FROM pivotx_entries -- module_search.php - getWordSql():845  -- 0.001 sec.
    [4] => SELECT COUNT('uid') AS count FROM pivotx_pages -- module_search.php - getWordSql():847  -- 0.001 sec.
    [5] => SELECT e.*, e.uid AS code, e.comment_count AS commcount, e.comment_names AS commnames, e.trackback_count AS trackcount, e.trackback_names AS tracknames, c.category FROM pivotx_entries AS e LEFT JOIN pivotx_categories AS c ON ( e.uid = c.target_uid ) WHERE ( e.status = 'publish' AND c.category IN('default', 'linkdump') ) GROUP BY e.uid ORDER BY e.date DESC LIMIT 10; -- entries_sql.php - read_entries():664  -- 0.002 sec.
    [6] => SELECT uid FROM pivotx_entries WHERE MATCH(title, subtitle, introduction, body, keywords) AGAINST ('football') AND status='publish'; -- module_search.php - getWordSql():824  -- 0.001 sec.
    [7] => SELECT uid FROM pivotx_pages WHERE MATCH(title, subtitle, introduction, body, keywords) AGAINST ('football') AND status='publish'; -- module_search.php - getWordSql():835  -- 0 sec.
    [8] => SELECT uid, uri, title, subtitle, user, date, chapter, sortorder, status, template, SUBSTRING(introduction, 1, 200) as introduction FROM pivotx_pages ORDER BY sortorder; -- pages_sql.php - getIndex():85  -- 0.001 sec.
    [9] => SHOW TABLES LIKE 'pivotx_%' -- entries_sql.php - EntriesSql():95  -- 0.001 sec.


However, it seems that now I'm able to find words in pages again, but not entries. As you see, I searched for the word 'football', and it should find that in one of the entries.
User avatar
Schop
Contributor
 
Posts: 485
Joined: Mon Apr 21, 2008 1:47 pm
Location: Hudson, Ohio

Re: Search Bug

Postby hansfn » Wed Sep 23, 2009 12:58 pm

OK, I have no clue. Have you tested with a new entry to kick off an update of the full-text entry index in MySQL? If that doesn't work, I would need FTP access (or database access ala phpMyAdmin) to see what is going on. Or maybe Bob has an idea?
hansfn
Developer
 
Posts: 3281
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Next

Return to 2.x Bugs

Who is online

Users browsing this forum: No registered users and 3 guests

cron