Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-17 11:16:56

mikkeX
Archived Plugin Author
Registered: 2004-02-26
Posts: 74

Paging and search results

When I do a search on my site I can not get to page two in the search results if I have two search words – in the link for the results I get an %2B instaed of + between search word.

You could see it here:
http://etc.gimmikk.se/?q=johan+ehrenberg

Offline

#2 2006-03-17 16:19:51

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Paging and search results

That’s strange, it’s working on my site: http://doggiez.nl/zoek/?q=de+hond

Could it be related to your browser’s character encoding? Oh no, or else I wouldn’t see the problem on your site… Sorry for that.

Last edited by els (2006-03-17 16:21:45)

Offline

#3 2006-03-17 20:20:56

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Paging and search results

Blimey, that brings up a few variations doesn’t it Els?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#4 2006-03-17 20:38:27

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Paging and search results

Yeah, great example, isn’t it ;) But now I notice something strange: on mikkeX’s page 2 the + becomes %2B (which doesn’t work), on mine it remains a +, and on yours it becomes %20 (http://thebombsite.com/search/?q=the+web), and that does work. Hmm…

Offline

#5 2006-03-17 20:49:44

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Paging and search results

Well if memory serves %20 is a “space” which is correct so should work. Don’t forget, you don’t need to put the “+” sign into the search box. I have no idea what %2B is???

I think some of these things can be put down to the smaller details of how a server is set up. Don’t know about this one though.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#6 2006-03-17 20:52:18

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Paging and search results

A good observation. That is weird, I wouldn’t know why it is happening (though I’m curious to know), but I can tell you why that causes the problem.

Textpattern apparently does not decode search query strings before it searches for them. The result is that, even though a plus sign (+) is equivalent to %2B, and a space (%20) or a plus sign should have the same results, the database searches for a literal %2B string, which of course, doesn’t exist.

Offline

#7 2006-03-17 22:38:58

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Paging and search results

thebombsite wrote:

Don’t forget, you don’t need to put the “+” sign into the search box.

No, all this happens when you just enter two words with a space in between. Textpattern adds the + in the url on the first search results page, and only on a second page the + gets transformed (or not).

Offline

#8 2006-03-20 06:50:55

mikkeX
Archived Plugin Author
Registered: 2004-02-26
Posts: 74

Re: Paging and search results

As Els says two words and space and i get %2B

My code from the page:

<txp:if_search>
<div id="artikeltext">
<txp:output_form form="search_input_result" />
<br /><br />
<txp:article limit="15" searchall=1 />
<p class="brodtext center">
<txp:newer><strong><< Föregående</strong></txp:newer>
<txp:older><strong>Nästa >></strong></txp:older> </p>
</div>
<txp:else />

My htaccess:

php_flag zlib.output_compression On 
php_value zlib.output_compression_level 5
php_flag display_errors 1
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.*) index.php
</IfModule>
Options +Indexes

Last edited by mikkeX (2006-03-20 06:59:09)

Offline

#9 2006-03-21 19:10:39

mikkeX
Archived Plugin Author
Registered: 2004-02-26
Posts: 74

Re: Paging and search results

bump.
Someone?

Offline

#10 2006-03-22 00:28:39

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Paging and search results

Yes?

Offline

#11 2006-03-22 21:37:33

mikkeX
Archived Plugin Author
Registered: 2004-02-26
Posts: 74

Re: Paging and search results

Sorry – but I do nout understand that – how could that answer solve the problem?

If you see the HTML that Textpattern produces on the site it does not work, if i manually edit the url and replace it with an + it does work, so should I file under bug report? And does somone have a solution?

The url for page two that Textpattern generates is:
http://etc.gimmikk.se/?pg=2&q=johan%2Behrenberg
and it does not work.
What would work is:
http://etc.gimmikk.se/?pg=2&q=johan+ehrenberg

Last edited by mikkeX (2006-03-22 21:45:55)

Offline

#12 2006-03-23 00:30:07

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Paging and search results

It doesn’t, that’s the point, there isn’t a way for you to fix it, short of editing one of the files.

Offline

Board footer

Powered by FluxBB