Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2013-05-31 13:57:41

mistersugar
Member
From: North Carolina
Registered: 2004-04-13
Posts: 141
Website

Re: Search results disappeared

And vickilh, how did I not know that my own public library is using Textpattern!

Offline

#26 2013-05-31 14:43:36

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: Search results disappeared

vickilh, have you found this troubleshooting article in the wiki?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#27 2013-05-31 14:54:17

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: Search results disappeared

:-) Did you replace your TXP search with the duckduckgo? Why did you go with that instead of google search? — Does it make sense to you that TXP search results could change like that?

Thx! Vicki

Offline

#28 2013-05-31 15:05:11

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: Search results disappeared

Hi Uli,

I did see that article yesterday, but I looked at it more closely today. A couple of things I haven’t mentioned: I have a search template, “chpl-search”, with a section called “Search” (capital “S”).

And something that is surely unrelated but I’ll mention. All these years when I went to the Pages tab, a (very very old) template called “default” would come up by default, no matter what other pages I added. – But recently that changed so that the template “chpl_default” (which is the one we’ve used for almost the life of the website) comes up by default instead.

thanks! Vicki

Offline

#29 2013-05-31 19:42:31

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: Search results disappeared

Please don’t give up on me yet guys!

Based on this page, I’m thinking that the action= specification needs to point to my Search section (? how was this working before??) I tried that with a test page, but still doesn’t work.

Here is the search form:

<form role="search" class="site-search" action="/txp/?s=Search" method="get"> 
        <div style="float:left;">
        <input type="text" name="q" id="q" size="23" onfocus="this.value='';"  class="searchbox_textbox" value="Search website ..."  onChange="submit()" />
        </div>
        <div class="searchbox_button">
                <input type="image" name="Header1:SearchBox1:searchButton" id="Header1_SearchBox1_searchButton" src="images/go_Button.gif" alt="Submit search" border="0" />
        </div>
</form>

I also tried adding the if_search code to my “default” section page, but no go.

Another STRANGE thing I noticed today. My error_results has, again, been working fine for years. And then I noticed today that the PHP in the top half (yes, only the top half) was no longer being recognized. When I switched it to using <txp:php>, everything was ok. The bottom half of the page works fine with regular PHP.

I’m wondering if I changed the “default” Section page at some point recently. The default page is never used and is super old. The “default” Section now uses the up-to-date chpl_default page. Could this affect things like my Search and the error_results?

Help!! Should I just switch out my search to Google search? Help! Thx, Vicki

{Edited to make Textile work. – Uli}

Last edited by uli (2013-05-31 20:50:24)

Offline

#30 2013-05-31 19:49:27

etc
Developer
Registered: 2010-11-11
Posts: 5,054
Website GitHub

Re: Search results disappeared

Please put the site in debug mode, make a search and report back any error messages.

Offline

#31 2013-06-01 12:18:44

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: Search results disappeared

vickilh wrote:

<form role="search" class="site-search" action="/txp/?s=Search" method="get"> 
        <div style="float:left;">
        <input type="text" name="q" id="q" size="23" onfocus="this.value='';"  class="searchbox_textbox" value="Search website ..."  onChange="submit()" />
        </div>
        <div class="searchbox_button">
                <input type="image" name="Header1:SearchBox1:searchButton" id="Header1_SearchBox1_searchButton" src="images/go_Button.gif" alt="Submit search" border="0" />
        </div>
</form>

Vicki, the code above won’t produce the below output which I found on every page I checked:

<form action="/txp/index.php" method="get">
	<div style="float:left;">
        <label for="Header1_SearchBox1_request" style="display:none;">Search website pages</label>
	<input type="hidden" name="s" value="Search" />

	<input type="text" name="q" id="q" size="23" onfocus="this.value='';"  class="searchbox_textbox" value="Search website..."  onChange="submit()" />
        </div>
	<div class="searchbox_button">
		<input type="image" name="Header1:SearchBox1:searchButton" id="Header1_SearchBox1_searchButton" src="/images/go_Button.gif" alt="Submit search" border="0" />
	</div>
</form>

So there has to be another template (or a form) that holds the code for a search.

vickilh wrote:

I’m wondering if I changed the “default” Section page at some point recently. The default page is never used and is super old. The “default” Section now uses the up-to-date chpl_default page. Could this affect things like my Search and the error_results?

What matters is whether the templates you changed are in use by your sections and whether they’re set to be used in a site search in the Sections panel.

error_results

Have you had errors while switching to debug or do you just mean the lack of search results?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#32 2013-06-01 13:57:53

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: Search results disappeared

I’ve never used debug mode before, and I don’t have a test server, so I’m a little nervous about doing this.

— Looking at the TXP docs. for using debug, it says that you look at the html page source to see the debug msgs? — So I could put it in debug mode for a minute, run a search and look at the html page source of the originating and results pages?

And there is NO chance that putting it in debug mode will do anything to my site once I put it back into Live mode? thx! vicki

Offline

#33 2013-06-01 15:00:01

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Search results disappeared

mistersugar wrote:

Interesting. I’ve noticed much-degraded search results — as in, no results for words I know are used plenty throughout my blog — over the last couple of months. I hadn’t changed my search form since I put it in place many years ago. Got so bad that I added a DuckDuckGo search yesterday. I’ll have to troubleshoot this weekend.

Textpattern uses MySQL’s full-text search indexes to perform content searches. Textpattern itself doesn’t contain any searching or indexing related functionality. Textpattern merely passes the search term to MySQL and it looks into its generic full-text index.

The results you get will change as your site grows.

To name few, you won’t get any results for stopwords, for words too common, words too short/long, searches interpreted by natural language as something else.

You may get degraded results if your database tables use wrong encoding/localization, you are searching in language that does not have word delimiters (e.g. Japanese), or your index is in bad shape.

You can try to repair your index by running a repair statement:

REPAIR TABLE textpattern

Through CLI or some database management client. This will rebuild your full text index for your articles, making sure the index is at least up to date.

vickilh wrote:

And there is NO chance that putting it in debug mode will do anything to my site once I put it back into Live mode? thx! vicki

Debugging mode doesn’t alter your site. It just makes errors and other debugging data, like the tag trace, visible.

Last edited by Gocom (2013-06-01 15:01:40)

Offline

#34 2013-06-01 17:14:01

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: Search results disappeared

Ok! Here is the Debug output from my Search page. The top part showed on the page, the bottom part was from the page source. I’m not sure what to make of it — anyone able to translate?? Thanks! vicki

 Tag error: <txp:article sort="Posted desc" searchform="search_results" /> ->  Textpattern Warning: Can't find FULLTEXT index matching the column list
select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod, match (`Title`, `Body`) against ('hours') as score from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (`Title` like '%hours%' or `Body` like '%hours%') and Section != 'Search' and Section != 'search-page' and Section != 'old' and Section != 'Site-Index' and Section != 'test-new' and Section != 'test-custom' and Section != 'announcement' and Section != 'test-mobile-teens' and Section != 'test-mobile-kids' and Section != 'not-found' order by Posted desc limit 0, 10
textpattern/lib/txplib_db.php:227 startRows()  on line 89

textpattern/lib/txplib_db.php:89 trigger_error()
textpattern/lib/txplib_db.php:289 safe_query()
textpattern/lib/txplib_db.php:227 startRows()
textpattern/publish.php:815 safe_rows_start()
textpattern/publish.php:964 doArticles()
textpattern/publish.php:592 parseArticles()
textpattern/publish.php:1188 article()
textpattern/publish.php:1100 processTags()
textpattern/publish/taghandlers.php:3586 parse()
textpattern/publish.php:1188 if_search()

Tag error: <txp:if_article_category> ->  Textpattern Notice: Article tags cannot be used outside an article context  on line 2324

textpattern/lib/txplib_misc.php:2324 trigger_error()
textpattern/publish/taghandlers.php:3633 assert_article()
textpattern/publish.php:1188 if_article_category()
textpattern/publish.php:1113 processTags()
textpattern/publish.php:538 parse()
index.php:45 textpattern()

Tag error:  ->  Textpattern Warning: Raw PHP tags are deprecated  on line 1236

textpattern/publish.php:1236 trigger_error()
textpattern/publish.php:542 evalString()
index.php:45 textpattern()

=========================================================================
<!-- Runtime:    0.0641 -->
<!-- Query time: 0.044604 -->
<!-- Queries: 12 -->
<!-- Memory: 4460Kb, <txp:if_article_category> -->
<!-- txp tag trace: 
[SQL (0.0076961517333984): select name, data from txp_lang where lang='en-us' AND ( event='public' OR event='common')]
[SQL (0.0013840198516846): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0.00031805038452148): select page, css from txp_section where name = 'Search' limit 1]
[SQL (0.00025200843811035): select host from txp_log where ip='96.10.236.63' limit 1]
[SQL (0.00020909309387207): insert into txp_log set `time`=now(),page='/txp/index.php?s=Search&q=hours',ip='96.10.236.63',host='rrcs-96-10-236-63.midsouth.biz.rr.com',refer='',status='200',method='GET']
[SQL (0.00039005279541016): select user_html from txp_page where name='chpl_search']
[Page: chpl_search]
<txp:page_title separator=" | " />
<txp:if_search>
	[<txp:if_search>: true]
	<txp:article pgonly="1" />
		[SQL (0.00019097328186035): select name from txp_section where searchable != '1']
		[SQL (0.016350984573364): select count(*) from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (`Title` like '%hours%' or `Body` like '%hours%') and Section != 'Search' and Section != 'search-page' and Section != 'old' and Section != 'Site-Index' and Section != 'test-new' and Section != 'test-custom' and Section != 'announcement' and Section != 'test-mobile-teens' and Section != 'test-mobile-kids' and Section != 'not-found']
	<txp:search_result_count />
	<txp:article sort="Posted desc" searchform="search_results" />
		[SQL (0.00023007392883301): select name from txp_section where searchable != '1']
		[SQL (0.016342163085938): select count(*) from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (`Title` like '%hours%' or `Body` like '%hours%') and Section != 'Search' and Section != 'search-page' and Section != 'old' and Section != 'Site-Index' and Section != 'test-new' and Section != 'test-custom' and Section != 'announcement' and Section != 'test-mobile-teens' and Section != 'test-mobile-kids' and Section != 'not-found']
		Tag error: <txp:article sort="Posted desc" searchform="search_results" /> -> Textpattern Warning: Can't find FULLTEXT index matching the column list
select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod, match (`Title`, `Body`) against ('hours') as score from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (`Title` like '%hours%' or `Body` like '%hours%') and Section != 'Search' and Section != 'search-page' and Section != 'old' and Section != 'Site-Index' and Section != 'test-new' and Section != 'test-custom' and Section != 'announcement' and Section != 'test-mobile-teens' and Section != 'test-mobile-kids' and Section != 'not-found' order by Posted desc limit 0, 10
textpattern/lib/txplib_db.php:227 startRows()  on line 89
		[SQL (0.00030303001403809): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod, match (`Title`, `Body`) against ('hours') as score from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (`Title` like '%hours%' or `Body` like '%hours%') and Section != 'Search' and Section != 'search-page' and Section != 'old' and Section != 'Site-Index' and Section != 'test-new' and Section != 'test-custom' and Section != 'announcement' and Section != 'test-mobile-teens' and Section != 'test-mobile-kids' and Section != 'not-found' order by Posted desc limit 0, 10]
</txp:if_search>
<txp:if_article_category>
	Tag error: <txp:if_article_category> -> Textpattern Notice: Article tags cannot be used outside an article context  on line 2324
	[<txp:if_article_category>: false]
</txp:if_article_category>
[ ~~~ secondpass ~~~ ]
Tag error:  -> Textpattern Warning: Raw PHP tags are deprecated  on line 1236
 -->

Offline

#35 2013-06-01 19:11:43

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Search results disappeared

vickilh wrote:

Ok! Here is the Debug output from my Search page. The top part showed on the page, the bottom part was from the page source. I’m not sure what to make of it — anyone able to translate?

As hinted by the error, there is no working full text index in textpattern table for columns Body or Title, which prevents the search from working. This could indicate that the table or index data is corrupted, was removed otherwise, or isn’t otherwise working properly.

First thing you could try to do is to repair your tables in your database, particularly the textpattern table, hosting all your articles, and its indexes. You can do that by running a query like:

repair table textpattern

You can run the query through CLI (over ssh) or using some database management tool (like phpMyadmin). Tools such as phpMyadmin also offer GUI to do the same.

If it doesn’t help, run diagnostics (verify) to check statuses and check the state of the database overall. Particularly see if the table has indexes in it. If the database was indeed fuck up to a extent that can not be solved by the repair, you should restore the database from a back up.

Last edited by Gocom (2013-06-01 19:13:42)

Offline

#36 2013-06-02 17:12:11

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: Search results disappeared

UPDATE!

- I ran Check table – status ok.
- I ran Repair table – ok. (didn’t help, Search still not working.)
- I ran Alter table – ok. (didn’t help)
- I dumped and reloaded table. (didn’t help)
- I dumped and reloaded all databases. (didn’t help)
- I restarted mysqld. (didn’t help)

And then I put Textpattern is debug mode again, and LO AND BEHOLD the Search was working! And continued to work once I put it in Live mode again.

Seems very weird how debug mode sort of jogged it. But I’m not complaining!!

Thanks to everyone for your help!!! Vicki

Offline

Board footer

Powered by FluxBB