- 🇧🇪Belgium tim-diels Belgium 🇧🇪
This looks good, but there must be steps to test this or maybe even an automated test?
- Status changed to Postponed: needs info
8 months ago 8:01am 20 March 2024 - 🇧🇪Belgium tim-diels Belgium 🇧🇪
I'm testing this with the search_api module and to my testing, it doesn't need a bigint data_type for search_api.
Steps I took:
- Intall bigint
- Install search_api
- Add bigint field to a content type
- Add an index with a database backend
- Add the bigint field
- Index the content
You can see in the database, the field is indexed as a bigint datatype.
So we'll need more info on why it is not working for you and what is not working.
- Status changed to Active
8 months ago 10:36am 20 March 2024 - 🇫🇮Finland sokru
The Search API backend also needs to support the Bigint datatype. The referenced issue for Elasticsearch #3198497: Support 64-bit integer numeric value → has a patch for Elasticsearch and for search_api_db the search_api module needs following patch (for 8.x-1.13 release)
diff --git a/modules/search_api_db/src/Plugin/search_api/backend/Database.php b/modules/search_api_db/src/Plugin/search_api/backend/Database.php index a7ed3c7f..ee631d42 100644 --- a/modules/search_api_db/src/Plugin/search_api/backend/Database.php +++ b/modules/search_api_db/src/Plugin/search_api/backend/Database.php @@ -945,6 +945,7 @@ class Database extends BackendPluginBase implements AutocompleteBackendInterface case 'uri': return ['type' => 'varchar', 'length' => 255]; + case 'bigint': case 'integer': case 'duration': case 'date': @@ -1683,6 +1684,7 @@ class Database extends BackendPluginBase implements AutocompleteBackendInterface } return $value; + case 'bigint': case 'integer': case 'date': return (int) $value;
Adding the tests is a bit cumbersome since currently it would require an above patch for search_api module.
- 🇧🇪Belgium tim-diels Belgium 🇧🇪
I see. Thanks for the information. I'm not able to test for the elasticsearch part for now.
And in my understanding, 2 other modules need patches to get this working:
* elasticsearch_connector
* search_api => search_api_db (submodule)So the maintainers of those modules will need to be willing to include the patch before we can think to implement this in our module as otherwise it is very hard to maintain.