magento2 – Magento 2.4 with ElasticSearch – include category name in index?

Is there a way to get Magento 2.4 with ElasticSearch to also index the category name alongside the product? For example, I would like someone searching for “wine” to find not only products with wine in the product name, but also products that are in the “Wine” category.

Is it possible to add additional data into the search index to achieve this?

java – Spring data Elasticsearch String Query returns empty content

I’ve a custom implementation to execute Elasticsearch queries but it never returns any values.

Spring data custom repo method:

@Override
public Page<T> customSearchPage(String source, Pageable pageable) {
    StringQuery searchQuery = new StringQuery(source, pageable);
    SearchHits<T> result = operations.search(searchQuery, getEntityClass());

    List<T> listResults = (List<T>) SearchHitSupport.unwrapSearchHits(result);

    return new PageImpl<>(listResults, pageable, result.getTotalHits());
}

Caller:-

Page<League> entityPage = repository.customSearchPage(query, pageable);

Query being passed in:-

{ "match" : { "providerId" : { "query" : "12" } } }

The same query returns a result when I directly run it from a Kibana console. Is there something that is not right here?

elasticsearch – Magento2 Elastic search / Elastic suite module from Smile

I ran this module on my website:
https://github.com/Smile-SA/elasticsuite

Everything seems to be working fine. But I have a problem with the configuration.

When I start search, gets the result but only the product names:
enter image description here

How to display here also additional attributes, like product image, price, add to the basket etc?

magento2.4 – Magento 2.4.1 and Elasticsearch 7.6.2 “no mapping found” issue

I’m facing an issue with a fresh install of Magento 2.4.1 and Elasticsearch 7.6.2.
The products appear for a moment, and I have to reindex again to see them.

The main issue appears to be “No mapping found for (position_category_xxxx) in order to sort on”

(2020-10-31 08:15:23) main.CRITICAL: {"error":{"root_cause":({"type":"query_shard_exception","reason":"No mapping found for (position_category_12) in order to sort on","index_uuid":"AWmVw6XqQsikmOu6IfXvNg","index":"magento2_product_1_v4"}),"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":({"shard":0,"index":"magento2_product_1_v4","node":"2Nx7OzfeT8OB1JixlyNJng","reason":{"type":"query_shard_exception","reason":"No mapping found for (position_category_12) in order to sort on","index_uuid":"AWmVw6XqQsikmOu6IfXvNg","index":"magento2_product_1_v4"}})},"status":400} {"exception":"(object) (Elasticsearch\Common\Exceptions\BadRequest400Exception(code: 400): {"error":{"root_cause":({"type":"query_shard_exception","reason":"No mapping found for (position_category_12) in order to sort on","index_uuid":"AWmVw6XqQsikmOu6IfXvNg","index":"magento2_product_1_v4"}),"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":({"shard":0,"index":"magento2_product_1_v4","node":"2Nx7OzfeT8OB1JixlyNJng","reason":{"type":"query_shard_exception","reason":"No mapping found for (position_category_12) in order to sort on","index_uuid":"AWmVw6XqQsikmOu6IfXvNg","index":"magento2_product_1_v4"}})},"status":400} at /var/www/vhosts/mywebsite.com/httpdocs/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:632)"} ()

It’s a clean install without any extension or custom theme.
Elasticsearch is running on a Docker container / Plesk. (3 nodes cluster).
I have 4 Magento 2.4.1 websites on the server.

Magento 2.35p2 EE with AWS ElasticSearch 6.8 – wrong products being returned

We recently upgraded from Magento EE 2.1.18 with ES 2.3 to Magento 2.3.5p2 with ES 6.8 on AWS.

The previous version of the system returns correct results when a user specifies a search keyword.

In the 2.3.5p2 version we are getting extraneous results – products that do not contain the search word are being displayed on the results page.

In examining the search logs in ES, the search query that Magento is generating looks correct.

There are no references to the incorrect products, yet on the results page the incorrect products are displayed.

How does Magento use the search results from ES to identify the products in the magento database to display?

Thank you.

migrate indexes from old version of elasticsearch to elasticsearch 7.9

we want to upgrade our elasticsearch version from 5.6 to 7.9 in our project.

I have to migrate our indexes and docs to new version but I cant use reindex, So I rest high level client to connect to elasticsearch 7 and use http request for elasticsearch 5.

For migration I get part of docs with match_all query and scroll from old version and index them in new elasticsearch with bulk request.

our old version elasticsearch has 3 node.My question is that I have to send request to all node separately and process docs or if I send match_all query search to one node it will be handled by elsaticsearch (I read sth about cordinating node that handle requests and Every node is implicitly a coordinating node cordinating node.) or I have to send request to data node

magento2 – Magento 2.3: How to configure fields to be used in Elasticsearch?

I need to configure the list of fields that are searched when you search in Magento. I am using Elasticsearch 7 as the engine. I need to stop it from searching by SKU and manufacturer, and add in a custom attribute to search by – either by changing what is indexed or changing what fields are searched.

I’m digging through all of the module-elasticsearch code, but it’s hard to find what I would need to override.

magento2 – How to configuration Elasticsearch in centOS 7 server for Magento 2.4

I want to configuration Elasticsearch in centOS 7 server for Magento 2.4. I have install Elasticsearch but not sure it is install or not.Because I have run this command sudo -i service elasticsearch start show below error :-

error: permission denied on key 'vm.max_map_count'
Starting elasticsearch: 
ERROR: The JDK bundled with Elasticsearch requires glibc >= 2.14, but
you have version 2.12. Please set the JAVA_HOME environment variable
to point to a working JDK installation. For more information, see:

https://www.elastic.co/support/matrix#matrix_jvm

enter image description here

Please Share me your suggestion.How to solve this error.

THANKS.

magento2.3.3 and “Amazon Elasticsearch Serviceā€ – “Connection failed! Test again?”

I have encountered the same problem in magento 2.3.3 and 2.3.5. My server is aws ec2 and “Amazon Elasticsearch Service” version 7.1. When I configure the magento backend, it always prompts “Connection failed! Test again? “, I followed your suggestion and checked the relevant information. I tried to ping “Endpoint” in ec2 ssh, and the connection timed out.

Endpoint can be accessed through the webpage normally, prompting me to enter http password authentication.
I use apache 2.4, do I need to configure a proxy?

Thanks, can you help me?

magento2.3.3 and “Amazon Elasticsearch Service” “Connection failed! Test again?”

performance – Elasticsearch update script using python bulk update

I’m using this script to bulk update docs in my index.
I need to update a field of a doc in Elasticsearch and add the count of that doc in a list inside python code. The weight field contains the count of the doc in a dataset. The dataset needs to be updated from time to time.So the count of each document must be updated too. hashed_ids is a list of document ids that are in the new batch of data. the weight of matched id must be increased by the count of that id in hashed_ids.
for example let say a doc with id=d1b145716ce1b04ea53d1ede9875e05a and weight=5 is already present in index. and also the string d1b145716ce1b04ea53d1ede9875e05a is repeated three times in the hashed_ids so the update_with_query query will match the doc in database. I need to add 3 to 5 and have 8 as final weight.
The code below works for it but it is too slow and from time to time I get time out error.

hashed_ids = (hashlib.md5(doc.encode('utf-8')).hexdigest() for doc in shingles)
update_by_query_body =
{
  "query":{
    "terms": {
      "id":("id1","id2")
    }
  },
  "script":{
    "source":"long weightToAdd = params.hashed_ids.stream().filter(idFromList -> ctx._source.id.equals(idFromList)).count(); ctx._source.weight += weightToAdd;",
    "params":{
      "hashed_ids":("id1","id1","id1","id2")
    }
  }
}