Open use-the-fork opened 3 days ago
If you try:
$query->whereExact('item_number.keyword', $item['item_number']);
and
ConfiguredItem::whereExact('request.business_unit.keyword', $item['business_unit']))->get();
Then still the same issue?
Mapping order matters, so if you map the $index->keyword
first and then $index->text
; then keyword
is used by default, and the field still remains text
analysed for full-text searching. Just how ES works, they could really do that one better...
Let me know
yes same issue. But let me try moving the mapping around I didn't think about that.
No Same result. Here is my updated mapping:
Here it is when I ask for mapping directly:
and doing this:
ConfiguredItem::whereExact('request.business_unit', $item['business_unit'])->toSql();
and this:
onfiguredItem::queryNested('request', function ($query) use ($item) {
$query->whereExact('business_unit', $item['business_unit']); //or comments.country
})->toSql()
fails.
Definitely a bug. I'll look into it. Thanks
@pdphilip I fixed it. Raising a PR later today. It's because of the "." notation mostly
Describe the bug
When using
whereExact
with either aqueryNested
or by using dot notation aParameterException
occurs. This seems to be a direct result of theparseRequiredKeywordMapping
helper in the Bridge.To Reproduce
Create a nested field mapping as part of the schema make sure it has a keyword mapping and then query in either of these fashions:
Expected behavior
This should work as long as long as the field is mapped to a keyword field.
Screenshots: