haha Posted September 27, 2013 Share Posted September 27, 2013 Hey, I think i can not search with chinese character, after i input chinese character i can not got search result,there would be empty result Link to comment Share on other sites More sharing options...
teppo Posted September 27, 2013 Share Posted September 27, 2013 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 More sharing options...
haha Posted September 27, 2013 Author Share Posted September 27, 2013 I'm talking about site front-end, (I just not have tried admin search) there http://tongcheji.com as i input chinese word i would got none search result, you could reproduce on my website the latest version of processwire i'm using. Link to comment Share on other sites More sharing options...
adrian Posted September 27, 2013 Share Posted September 27, 2013 I just searched for: 游览本站 on your site and it returned one result. Can you post the search term you are testing? Link to comment Share on other sites More sharing options...
haha Posted September 27, 2013 Author Share Posted September 27, 2013 好孩子 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 More sharing options...
adrian Posted September 27, 2013 Share Posted September 27, 2013 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 More sharing options...
haha Posted September 27, 2013 Author Share Posted September 27, 2013 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 1 Link to comment Share on other sites More sharing options...
adrian Posted September 27, 2013 Share Posted September 27, 2013 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 More sharing options...
haha Posted September 27, 2013 Author Share Posted September 27, 2013 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 More sharing options...
adrian Posted September 27, 2013 Share Posted September 27, 2013 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now