Hello PHP Lions,
Can OSSN support the integration of the ElasticSearch library which allows a more typo-tolerant search? thx
yes Arslan it's already done, it's by the error_log
file that I was able to detect where the problem is. thank you for your help
In future when you integerate something login into admin first and you will see actual errors instead of code like
#1703710134|MDER9NBQIB29BFS5E37L8GUK5A
However for such a codes the exact error can be looked in error log for timestamp example 1703710134
Thank you Arsalan :D
Glad that you found the issue!
For people who will encounter the same problem as me in the future
Elastic Search recently changed the location of ClientBuilder in their package. You'll have to update your use statement.
Change this:
use Elasticsearch\ClientBuilder;
to this:
use Elastic\Elasticsearch\ClientBuilder;
I try to integrate ElasticSearch but I receive this error
#1703710134|MDER9NBQIB29BFS5E37L8GUK5A
the problem is in
$client = ClientBuilder::create()->setHosts(['localhost:9200'])->build();
here is my test code:
require __DIR__ . '/vendor/autoload.php';
// Using the namespace for the ClientBuilder class
use Elasticsearch\ClientBuilder;
// Configuring the connection to Elasticsearch
$hosts = [
'localhost:9200' // Address and port of your Elasticsearch cluster
];
try {
$client = ClientBuilder::create()->setHosts(['localhost:9200'])->build();
} catch (\Exception $e) {
echo "Error creating Elasticsearch client: ". $e->getMessage();
// You can add other error handling actions if necessary
exit;
}
// Name of the index we are going to create (in this example, "professions")
$index = 'professions';
// Definition of the mapping (structure) of documents in the index
$mapping = [
'index' => $index,
'body' => [
'mappings' => [
'properties' => [
'profession' => ['type' => 'text'],
// Add other properties of your profession here
]
]
]
];
...... the rest of the code
In principle this should display the error message
try {
$client = ClientBuilder::create()->setHosts(['localhost:9200'])->build();
} catch (\Exception $e) {
echo "Error creating Elasticsearch client: ". $e->getMessage();
// You can add other error handling actions if necessary
exit;
}
but it doesn't work.
My ElasticSearch Server is runing correctly
{
"name" : "DESKTOP-4CFMHET",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "qPdEbqZ0SxiAVKDh8yd5pQ",
"version" : {
"number" : "8.11.3",
"build_flavor" : "default",
"build_type" : "zip",
"build_hash" : "64cf052f3b56b1fd4449f5454cb88aca7e739d9a",
"build_date" : "2023-12-08T11:33:53.634979452Z",
"build_snapshot" : false,
"lucene_version" : "9.8.0",
"minimum_wire_compatibility_version" : "7.17.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "You Know, for Search"
}
You need to read their documentation and then try to integrate into OSSN, ElasticSearch is independent library didn't depend on any platform and can be integrated into any platform if you follow their docs.
Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)