Skip to content

Commit

Permalink
EZP-31817: Enabled ezfloat values indexing (#103)
Browse files Browse the repository at this point in the history
* EZP-31817: Enabled ezfloat values indexing

* fixup! EZP-31817: Enabled ezfloat values indexing

* fixup! EZP-31817: Enabled ezfloat values indexing
  • Loading branch information
adamwojs authored and ViniTou committed Nov 4, 2020
1 parent c2e7887 commit 1822cc4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,8 @@ protected function getValidSearchValueTwo()
return 25.59;
}

protected function getFullTextIndexedFieldData()
public function checkFullTextSupport(): bool
{
return [
['25.519', '25.59'],
];
return false;
}
}
9 changes: 8 additions & 1 deletion eZ/Publish/Core/FieldType/Float/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,12 @@ protected function checkValueStructure(BaseValue $value)

/**
* {@inheritdoc}
*
* @param \eZ\Publish\Core\FieldType\Float\Value $value
*/
protected function getSortInfo(BaseValue $value)
{
return false;
return $value->value;
}

/**
Expand Down Expand Up @@ -256,4 +258,9 @@ public function toHash(SPIValue $value)

return $value->value;
}

public function isSearchable(): bool
{
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static function create()
public function toStorageValue(FieldValue $value, StorageFieldValue $storageFieldValue)
{
$storageFieldValue->dataFloat = $value->data;
$storageFieldValue->sortKeyInt = $value->sortKey;
$storageFieldValue->sortKeyString = $value->sortKey;
}

/**
Expand All @@ -54,7 +54,7 @@ public function toStorageValue(FieldValue $value, StorageFieldValue $storageFiel
public function toFieldValue(StorageFieldValue $value, FieldValue $fieldValue)
{
$fieldValue->data = $value->dataFloat;
$fieldValue->sortKey = $value->sortKeyInt;
$fieldValue->sortKey = $value->sortKeyString;
}

/**
Expand Down Expand Up @@ -112,7 +112,7 @@ public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefin
*/
public function getIndexColumn()
{
return 'sort_key_int';
return 'sort_key_string';
}

/**
Expand Down

0 comments on commit 1822cc4

Please sign in to comment.