Jump to content

i cannot search with chinese character


haha
 Share

Recommended Posts

Hello there! I can't seem to reproduce this -- searching with Chinese characters works just fine for me.

Could you describe in a bit more detail what, where and how you're doing this? Are you talking about search in admin, site (front-end) or..? And just to make sure it's not something that's changed (though I can't think of such a thing right now) could you please provide the version of PW installed.

Link to comment
Share on other sites

好孩子

I just searched for: 游览本站 on your site and it returned one result.

Can you post the search term you are testing?

all right...   "好孩子"                   "石家庄市"             etc

Link to comment
Share on other sites

So perhaps you need to look at the code of your search.php template and see if the selector is including the fields where these words occur on your site.

$matches = $pages->find("title|body|sidebar~=$q, limit=50");

The default only searches the title, body and sidebar fields. Add any other relevant fields to that | separated list.

Does that help?

Link to comment
Share on other sites

So perhaps you need to look at the code of your search.php template and see if the selector is including the fields where these words occur on your site.

$matches = $pages->find("title|body|sidebar~=$q, limit=50");

The default only searches the title, body and sidebar fields. Add any other relevant fields to that | separated list.

Does that help?

 And all stuff of a website content is included with 'title body sidebar', how can i miss it? i'm not change the code of search.php

  • Like 1
Link to comment
Share on other sites

Are those search examples you gave complete, distinct "words", or are they part of a longer string of characters?

If the latter, then try changing the selector in the search.php file to:

$matches = $pages->find("title|body|sidebar%=$q, limit=50");

Note that I changed "~=" to "%="

Does that help?

Link to comment
Share on other sites

Are those search examples you gave complete, distinct "words", or are they part of a longer string of characters?

If the latter, then try changing the selector in the search.php file to:

$matches = $pages->find("title|body|sidebar%=$q, limit=50");

Note that I changed "~=" to "%="

Does that help?

it helps.   after i change this it works then.  does that give more Pressure to server?

Link to comment
Share on other sites

It will be somewhat slower, but unless you have a very large number of pages, I wouldn't worry too much about it. However, you might find that *= also works for you, and this doesn't have the speed issue because it makes use of the sql fulltext indexes. Experiment and see what works.

Have a read here: http://processwire.com/api/selectors/#operators

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...