Jump to content

No Elasticsearch web host! Any point upgrading to CubeCart 6.5.x or are we stuck at 6.4.10?


jasehead

Recommended Posts

Are the recent versions of CubeCart usable if we don't have a web host that supports Elasticsearch? Will future versions of CubeCart work across the board, or will all future updates be dependent on Elasticsearch?

Does that mean that CubeCart merchants without access to Elasticsearch are stuck at 6.4.10?  Will a non-elastic branch of CubeCart continue to be developed and updated, or at least security patched occasionally?

To quote Al from 2017, considering adding Elasticsearch to CubeCart:

Quote

It will never happen because the vast majority of our merchants have generic shared web hosting which will never be compatible with ElasticSearch.

We could integrate it but only for merchants who have there own dedicated server or VPS and are happy configuring ElasticSearch.

Sadly this just doesn't fit our demographic and the development time required to implement this isn't worth while.

 

Link to comment
Share on other sites

  • 3 weeks later...

Try setting the values in the includes/global.inc.php file (in most cases the last two can be ignored):

$glob['es_h']                      = '';               // Elasticsearch host e.g. https://localhost:9200

$glob['es_u']                      = '';               // Elasticserch username

$glob['es_p']                      = '';               // Elasticsearch password

$glob['es_i']                        = '';               // Elasticsearch index name

$glob['es_v']                      = '';               // Elasticsearch vertificate validation enum('1','0')

$glob['es_c']                       = '';               // Elasticsearch certificate path

Link to comment
Share on other sites

I would think not.

What you refer to is the access credentials to the MySQL database server.

The mentioned $glob array elements for ElasticSearch would/should be different.

If your site is hosted, and your host gives you a site management tool (such as CPanel), and if ElasticSearch is installed by your host, the access credentials to the MySQL database and ElasticSearch engine should have been emailed to you in your new subscriber "Welcome" notice, or, at least, these connection details would be shown somewhere in the management tool.

 

 

Link to comment
Share on other sites

I am using cyberpanel. In that manage, elastisearch is application, can be install and remove.

When I set $glob['es_h'] = 'localhost:9200';  it able to select enable check box.

username, password and index name I sed from the global $glob['dbdatabase'] similarly...

In maintainance -> elasticsearch tab, it shouws the count and size, But can not see result on search box.

 

Is there any way/command to know this ES engine credential from the root access ?

Link to comment
Share on other sites

Add these fields to the includes/global.inc.php file with correct values. Please note that your skin may need changes if you are not using the default Foundation theme. 

$glob['es_h']                      = '';               // Elasticsearch host e.g. https://localhost:9200
$glob['es_u']                      = '';               // Elasticserch username
$glob['es_p']                      = '';               // Elasticsearch password
$glob['es_i']                        = '';               // Elasticsearch index name
$glob['es_v']                      = '';               // Elasticsearch vertificate validation enum('1','0')
$glob['es_c']                       = '';               // Elasticsearch certificate path

The last two fields can probably remain empty. 

Link to comment
Share on other sites

Great! Thank you very much. It is working, I used the database credential and host localhost:9200. In the search box, to get the drop down list product, need to use mouse cursor. Can we add keyboard up,down to reach to the downward list instead of mouse cursor. Even after click outside of the search box, ES search dropdown list wont disappear. Need to used ESC key. It would be good idea to add one click functionality to clear search dropdown list like ESC key.

  • Like 1
Link to comment
Share on other sites

That's my question: where does the index name come from? Is it auto-generated the first time ElasticSearch builds the index? Does the hosting provider assign it?

sack123, where did you get the value for 'es_i'?

(Note: The forum will not let me use the '@' notifier -- it refuses to allow a post that was edited to use it get re-saved. I hope you see this.)

Edited by bsmither
Link to comment
Share on other sites

bsmither, I used it same from global.inc.php ->  $glob['dbdatabase'] = ' **** '.

ES works fine now. But if I type keyword in search box and click on search buttom, it gives results,  where some of them even dont have that keyword in title. Any idea, how to fix that ?

Link to comment
Share on other sites

Unfortunately, sometimes, the spooled debug data gets lost (at least for me). That means, sometimes, we cannot know, absolutely, what search phase was last used to get results. (I am tracing the execution to find out how and where the debug data gets lost.) The search phases are, in order: Elasticsearch, Fulltext, RLike, Like.

However, an Elasticsearch query is coded to look in the 'name' ('title') and 'product_code', and if not using "Search as you type", the 'description' columns for the search term.

Please verify that the search term might actually appear in the description.

Also, Elasticsearch should have the capability, and might be configured to do so, to take a search term, then find its stem and lemma. (See Wikipedia.) As such, a 'hit' could contain words that have been expanded from the lemma. An example: search broken to get hits with break (this is the lemma), breaking, and broke.

And then, if the search phase actually gets to Like, verify that the search term might actually be just a part of a bigger word.

Edited by bsmither
Link to comment
Share on other sites

Ok, then how is it you want the results? If 'keyw' appears in the Name and/or Product Code, regardless if it appears in the Description, it will be in the list of hits.

You said if nothing was found in the Name or Product Code, then look in the Description.

So, what is the difference? Would there be a difference in how the hits are listed?

 

Link to comment
Share on other sites

"Where can I see the list of hits?"

The page that shows a grid of product panels for search results is the 'hits'.

"The product list appear should contain title Name and/or Product Code."

The list will always contain the name.

To inhibit looking in the 'description' column for search terms, make these edits:

In /classes/elasticsearchhandler.class.php, near line 255, from:
$should = array_merge($should, [['match' => ['description' => $q]]]);
To:
// $should = array_merge($should, [['match' => ['description' => $q]]]);

In /classes/catalogue.class.php, near line 1990, from:
$indexes = $GLOBALS['db']->getFulltextIndex('CubeCart_inventory', 'I');
To:
$indexes = $GLOBALS['db']->getFulltextIndex('CubeCart_inventory', 'I'); unset($indexes['description']);

Near line 2087, from:
$like = " AND (I.name ".$like_keyword." '".$regexp."' OR I.description ".$like_keyword." '".$regexp_desc."' OR I.product_code ".$like_keyword." '".$regexp."')";
To:
$like = " AND (I.name ".$like_keyword." '".$regexp."' OR I.product_code ".$like_keyword." '".$regexp."')";

 

Link to comment
Share on other sites

  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...