Question about ->where('attributeName', true)
Opened this issue · 1 comments
ametad commented
In my Elasticsearch index there is this mapping:
"attributeName": {
"type": "boolean"
},
Elasticsearch 5
In version 5 I can do a search like:
// Search for data where 'attributeName' is set to true.
ModelName::where('attributeName', 1)->get();
This is working great!
Elasticsearch 6
But In version 6 when I do a search like:
// Search for data where 'attributeName' is set to true.
ModelName::where('attributeName', 1)->get();
That doesnot work....
After some testing, I found out the following does work:
// Search for data where 'attributeName' is set to true.
ModelName::where('attributeName', 'true')->get();
Please notice the string 'true' instead of a php boolean true
.
Question
Is it intended to de a search for a boolean type like so:
ModelName::where('attributeName', 'true')->get();
ModelName::where('attributeName', 'false')->get();
Perhaps you can point me in the right direction?
ametad commented
Trying to be as thorough as possible, and as clear as possible:
// Search for data where 'attributeName' is set to true.
ModelName::where('attributeName', 'true')->get();
// Search for data where 'attributeName' is set to false.
ModelName::where('attributeName', 'false')->get();
// This does return all models where 'attributeName' is set to boolean false in the Elasticsearch index.