Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-12-20 17:07:45

hcgtv
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Google Site Search and internal Textpattern search

On PHPXref, I updated the Google Site Search code. I decided this time to display the results on my own site.

What I encountered on the search results page was a bit odd, at the top was Textpattern specific search results. For a time there, I thought Google knew what I was running and was including my own site’s results. Then it hit me.

This is the URL for a Textpattern search:

http://phpxref.com/?q=phpxref

This is the URL for a Google Site Search:

http://phpxref.com/search/?cx=partner-pub-9946645904786279%3A68icny7d1fx&cof=FORID%3A11&ie=ISO-8859-1&q=phpxref&sa=Search#869

What I think is happening, is that Textpattern is pulling out the ?* and the *q=phpxref from the Google derived URL.

Am I on the right track?

Offline

#2 2008-12-21 01:25:51

truist
Plugin Author
From: Ohio, USA
Registered: 2004-11-09
Posts: 257
Website

Re: Google Site Search and internal Textpattern search

Bert,

I’m not authoritative about this, but your theory fits what I know. TXP just takes the query string, parses it up, and then says “is there a parameter named ‘q’?” If so, it assumes you are doing a search.

I’m not sure what the fix is. Easiest (if possible) would be to have Google not use ‘q’ in their query. Next easiest is probably to tell TXP not to run searches when using that URL, although I’m not sure how to do that. You could also try to get TXP to use some parameter other than ‘q’ for its searches.

Offline

#3 2008-12-21 15:17:50

hcgtv
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: Google Site Search and internal Textpattern search

Hey Nathan,

When I get a chance I’ll see what I do, the easiest is changing the Textpattern code on PHPXref.

But as you suggest, I’m going to contact Google and ask them what they could do at their end. Textpattern was around long before Site Search was launched.

Offline

#4 2008-12-21 15:38:14

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

Re: Google Site Search and internal Textpattern search

You could remove <txp:article /> from that particular page (by surrounding the tag with <txp:if_section name="search"> etc), so Textpattern doesn’t run the search query nor output results.

Last edited by Gocom (2008-12-21 15:38:55)

Offline

#5 2008-12-21 16:33:19

hcgtv
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: Google Site Search and internal Textpattern search

Gocom,

That did the trick, I feel like a txp:tag newbie. As the saying goes, if you don’t use it, you lose it.

Thanks.

Offline

Board footer

Powered by FluxBB