I am using Elastic Search with Spring Data .
I have a simple method in repository:
findByUserNameContaining("a b");
This method not giving expecting result because of SPACE.
Error getting:
"Cannot constructQuery '"a b"'. Use expression or multiple clauses instead." EXCEPTION="org.springframework.dao.InvalidDataAccessApiUsageException: Cannot constructQuery '"a b"'. Use expression or multiple clauses instead.
For stopping creation of multiple tokens because of Space. I have mapping:
"userName": {
"type": "string",
"index": "not_analyzed"
},
I am totally surprised that I am getting this issue after "index": "not_analyzed"
in mapping .
Please help me. Thanks in advance!