Could you surport Chinese query

yipee - March 11, 2007 - 10:18
Project:Taxonomy Query Language
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Could you surport Chinese query

#1

rötzi - March 11, 2007 - 16:55

I tried now adding the "\w" word character class to the regular expression match. This should match all characters which your setup see's as a part of a word, so if the setup is chinese I hope it will match chinese characters. It's in CVS, so either get it from there or wait until the new dev package is created.

What is alredy working is using quotes, so using "⾿⾵" as a search term should alredy work, but this does not work with autocompletion.

So I would be glad if you can try the new dev version when it is ready. And if it does not work without the quotes there, we have to find a better regular expression for this. At the moment it is /[\w_a-zA-Z0-9]+/, where I hope that the \w will match chinese characters in your setup. If it does not I would be glad for some help how to make a regular expression which does match chinese (and other) characters.

#2

rötzi - March 11, 2007 - 20:25

I updated the module again. Now it should work with chinese characters, also autocompletion.

I would be glad if you could do some tests - with quotes, without quotes and autocompletion - and tell me if it works.

#3

yipee - March 12, 2007 - 18:22

rötzi

Thank you for your great job.

It work very well as plugin for search (Drupal core). But useing it as Views filter, I got following erro:

    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(node.nid) in (SELECT * FROM (SELECT DISTINCT nid FROM `term_node` WHERE' at line 1 query: SELECT count(DISTINCT(node.nid)) FROM node node WHERE (node.status = '1') AND (node.type IN ('album','article')) AND ( DISTINCT(node.nid) in (SELECT * FROM (SELECT DISTINCT nid FROM `term_node` WHERE tid in (217)) AS finalTable)) AND (node.uid = 1) in C:\wamp\www\includes\database.mysql.inc on line 172.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(node.nid) in (SELECT * FROM (SELECT DISTINCT nid FROM `term_node` WHERE' at line 1 query: SELECT DISTINCT(node.nid), node.sticky AS node_sticky, node.created AS node_created_created FROM node node WHERE (node.status = '1') AND (node.type IN ('album','article')) AND ( DISTINCT(node.nid) in (SELECT * FROM (SELECT DISTINCT nid FROM `term_node` WHERE tid in (217)) AS finalTable)) AND (node.uid = 1) GROUP BY node.nid ORDER BY node_sticky DESC, node_created_created DESC LIMIT 0, 10 in C:\wamp\www\includes\database.mysql.inc on line 172.

Could you check and fix it?

Thanks

#4

rötzi - March 12, 2007 - 18:53

Can you tell me which MySQL version you are using?

I tested MySQL '4.1.20' and '5.0.24', maybe it's a version problem.

And which other filters you activated in your view, then I can check if it is a compatibility problem with other fitlers.

#5

rötzi - March 12, 2007 - 19:07

At a second glance it looks like a problem of Views. The query you show has a part " DISTINCT(node.nid) in" which is wrong. But the tql module only creates the text "node.nid in" which would be correct. Thus it is probably a Views problem, not a MySQL one. It could be that Views or another filter adds the 'DISTINCT' around the 'node.nid'.

Which version of Views have you installed?

#6

rötzi - March 12, 2007 - 19:16

It probably is the 'node: Distinct' fitler. Can you remove that one and test if it works?

#7

yipee - March 12, 2007 - 23:11

Yes you are right. when I removed the Distinct' fitler, It works.

I hope you can find solution.

#8

rötzi - March 12, 2007 - 23:31
Status:active» fixed

This is the solution ;)

I don't think there occur any duplicates with the tql filter, so the 'node: Distinct' filter should not be needed at all. But if you see any duplicates please report.

I set this to fixed. If you have problems with duplicates, please reopen or make a new issue.

#9

Anonymous - March 26, 2007 - 23:46
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.