Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON string filtering case sensitivity #1135

Closed
sanikolaev opened this issue May 19, 2023 · 3 comments
Closed

JSON string filtering case sensitivity #1135

sanikolaev opened this issue May 19, 2023 · 3 comments

Comments

@sanikolaev
Copy link
Collaborator

sanikolaev commented May 19, 2023

It seem equals (and any) don't honor case sensitivity:

mysql -P9306 -h0 -e "drop table if exists t; create table t(s string); insert into t(s) values('abc');"  
  
curl -sX POST http://localhost:9308/search  -d '  
{  
  "index":"t",  
  "query": {  
    "equals": {  
      "s": "ABC"  
    }  
  }  
}' | jq .  
  
{  
  "took": 0,  
  "timed_out": false,  
  "hits": {  
    "total": 1,  
    "total_relation": "eq",  
    "hits": [  
      {  
        "_id": "1515343812221005518",  
        "_score": 1,  
        "_source": {  
          "s": "abc"  
        }  
      }  
    ]  
  }  
}  
  
curl -sX POST http://localhost:9308/search  -d '  
{  
  "index":"t",  
  "query": {  
    "equals": {  
      "s": "abcd"  
    }  
  }  
}' | jq .  
  
{  
  "took": 0,  
  "timed_out": false,  
  "hits": {  
    "total": 0,  
    "total_relation": "eq",  
    "hits": []  
  }  
}  

This looks wrong.

Tested in:

➜  ~ searchd -v  
Manticore 6.0.5 9164faaf0@230511 dev (columnar 2.0.5 24e76dd@230422) (secondary 2.0.5 24e76dd@230422)  
@githubmanticore
Copy link
Contributor

➤ Sergey Nikolaev commented:

The problem can be also seen via SQL over mysql:

mysql> drop table if exists t; create table t(s string); insert into t(s) values('abc'); select * from t where s = 'ABC'; 
-------------- 
drop table if exists t 
-------------- 
 
Query OK, 0 rows affected (0.01 sec) 
 
-------------- 
create table t(s string) 
-------------- 
 
Query OK, 0 rows affected (0.01 sec) 
 
-------------- 
insert into t(s) values('abc') 
-------------- 
 
Query OK, 1 row affected (0.00 sec) 
 
-------------- 
select * from t where s = 'ABC' 
-------------- 
 
+---------------------+------+ 
| id                  | s    | 
+---------------------+------+ 
| 1515343812221005535 | abc  | 
+---------------------+------+ 
1 row in set (0.00 sec) 

@githubmanticore
Copy link
Contributor

➤ Stan commented:

we have collation_server with default libc_ci that is why SphinxQL example provided does not work as should.
restarting daemon with collation_server = libc_cs make SphinxQL example work.

However collation_server option has no effect for requests via HTTP interface and that was fixed at 1d44492

@githubmanticore
Copy link
Contributor

➤ Stan commented:

I also created another ticket #3549 for suggestion of collation at HTTP request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants