magento2.4.0 – Magento 2.4 installation on local returning elasticsearch error

I have installed elasticsearch on local (xampp) and on http://localhost:9200/ is showing it is running.
But when I trying to install magento 2.4 getting elasticsearch error.

Magento installation command –

php bin/magento setup:install --base-url="http://127.0.0.1/magento2" --db-host="localhost" --db-name="magento2" --db-user="root" --db-password="" --admin-firstname="Test" --admin-lastname="Test" --admin-email="test@gamil.com" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="INR" --timezone="Asia/Kolkata" --use-rewrites="1" --backend-frontname="admin" --elasticsearch-host=elasticsearch --elasticsearch-port=9200

And getting below error –

Installing search configuration...

In SearchConfig.php line 81:

  Could not validate a connection to Elasticsearch. No alive nodes found in your cluster

What should I try to install magento 2.4?

magento2 – ElasticSearch does not return correct bucket information

I have 2 queries with elasticsearch that behave very differently with regards to the price bucket information

A first query with no filter returns all the expected info for the price bucket:

"price_bucket" : {
      "count" : 1190,
      "min" : 0.0,
      "max" : 239.95,
      "avg" : 0.6719663865546218,
      "sum" : 799.64,
      "sum_of_squares" : 102326.4176,
      "variance" : 85.53704739382812,
      "variance_population" : 85.53704739382812,
      "variance_sampling" : 85.60898771964294,
      "std_deviation" : 9.248624081117587,
      "std_deviation_population" : 9.248624081117587,
      "std_deviation_sampling" : 9.252512508483463,
      "std_deviation_bounds" : {
        "upper" : 19.169214548789796,
        "lower" : -17.82528177568055,
        "upper_population" : 19.169214548789796,
        "lower_population" : -17.82528177568055,
        "upper_sampling" : 19.176991403521548,
        "lower_sampling" : -17.833058630412303
      }
    },

Instead, when searching for the word ‘red’, the results are fine but the price_bucket in the aggregations node is returning barely any information:

"price_bucket" : {
      "count" : 48,
      "min" : 0.0,
      "max" : 0.0,
      "avg" : 0.0,
      "sum" : 0.0,
      "sum_of_squares" : 0.0,
      "variance" : 0.0,
      "variance_population" : 0.0,
      "variance_sampling" : 0.0,
      "std_deviation" : 0.0,
      "std_deviation_population" : 0.0,
      "std_deviation_sampling" : 0.0,
      "std_deviation_bounds" : {
        "upper" : 0.0,
        "lower" : 0.0,
        "upper_population" : 0.0,
        "lower_population" : 0.0,
        "upper_sampling" : 0.0,
        "lower_sampling" : 0.0
      }
    },

Query red filter

curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d'
{"from":0,"size":10000,"stored_fields":["_id","_score"],"sort":[{"_score":{"order":"desc"}}],"query":{"bool":{"must":[{"terms":{"visibility":["3","4"]}}],"should":[{"match":{"sku":{"query":"red","boost":2}}},{"match":{"_search":{"query":"red","boost":2}}},{"match":{"name":{"query":"red","boost":6}}},{"match":{"sku":{"query":"red","boost":7}}},{"match":{"description":{"query":"red","boost":2}}},{"match":{"short_description":{"query":"red","boost":2}}},{"match":{"manufacturer_value":{"query":"red","boost":2}}},{"match":{"status_value":{"query":"red","boost":2}}},{"match":{"url_key":{"query":"red","boost":2}}},{"match":{"tax_class_id_value":{"query":"red","boost":2}}},{"match":{"attr_16gb_premio_micro_sd_card":{"query":"red","boost":2}}},{"match":{"battery":{"query":"red","boost":2}}},{"match":{"bluetooth_speakers":{"query":"red","boost":2}}},{"match":{"brand_value":{"query":"red","boost":2}}},{"match":{"camera":{"query":"red","boost":2}}},{"match":{"cellular_network_value":{"query":"red","boost":2}}},{"match":{"clothing_type_value":{"query":"red","boost":2}}},{"match":{"color_value":{"query":"red","boost":2}}},{"match":{"size_value":{"query":"red","boost":2}}},{"match":{"data_100mb_12mnths":{"query":"red","boost":2}}},{"match":{"data_100mb_6mnths":{"query":"red","boost":2}}},{"match":{"data_200mb_6mnths":{"query":"red","boost":2}}},{"match":{"dual_sim":{"query":"red","boost":2}}},{"match":{"external_memory_slot":{"query":"red","boost":2}}},{"match":{"facebook":{"query":"red","boost":2}}},{"match":{"fm_radio":{"query":"red","boost":2}}},{"match":{"free_airtime":{"query":"red","boost":2}}},{"match":{"free_cover":{"query":"red","boost":2}}},{"match":{"free_data":{"query":"red","boost":2}}},{"match":{"free_sdcard":{"query":"red","boost":2}}},{"match":{"free_starter_pack":{"query":"red","boost":2}}},{"match":{"free_whatsapp_3gb_300mb":{"query":"red","boost":2}}},{"match":{"free_whatsapp_3gb_600mb":{"query":"red","boost":2}}},{"match":{"handset_ram_size":{"query":"red","boost":2}}},{"match":{"headset":{"query":"red","boost":2}}},{"match":{"image_name_label":{"query":"red","boost":2}}},{"match":{"mp3_player":{"query":"red","boost":2}}},{"match":{"os":{"query":"red","boost":2}}},{"match":{"otg_adapter":{"query":"red","boost":2}}},{"match":{"premio_micro_sd_card_16gb":{"query":"red","boost":2}}},{"match":{"product_attribute":{"query":"red","boost":2}}},{"match":{"product_decal":{"query":"red","boost":2}}},{"match":{"protective_cover":{"query":"red","boost":2}}},{"match":{"screen_protector":{"query":"red","boost":2}}},{"match":{"screen":{"query":"red","boost":2}}},{"match":{"tempered_glass":{"query":"red","boost":2}}},{"match":{"torch":{"query":"red","boost":2}}},{"match":{"two_back_covers":{"query":"red","boost":2}}},{"match":{"whatsapp":{"query":"red","boost":2}}},{"match":{"_search":{"query":"red","boost":2}}},{"match_phrase_prefix":{"name":{"query":"red","boost":2}}},{"match_phrase_prefix":{"sku":{"query":"red","boost":2}}}],"minimum_should_match":1}},"aggregations":{"price_bucket":{"extended_stats":{"field":"price_0_1"}},"category_bucket":{"terms":{"field":"category_ids","size":500}},"manufacturer_bucket":{"terms":{"field":"manufacturer","size":500}},"brand_bucket":{"terms":{"field":"brand","size":500}},"cellular_network_bucket":{"terms":{"field":"cellular_network","size":500}},"clothing_type_bucket":{"terms":{"field":"clothing_type","size":500}},"color_bucket":{"terms":{"field":"color","size":500}},"size_bucket":{"terms":{"field":"size","size":500}}}}
'

Query no filter

curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d'
{"from":0,"size":10000,"stored_fields":["_id","_score"],"sort":[{"_id":{"order":"desc"}}],"query":{"bool":{"must":[{"terms":{"visibility":["2","4"]}}]}},"aggregations":{"price_bucket":{"extended_stats":{"field":"price_0_1"}},"category_bucket":{"terms":{"field":"category_ids","size":500}},"manufacturer_bucket":{"terms":{"field":"manufacturer","size":500}},"brand_bucket":{"terms":{"field":"brand","size":500}},"cellular_network_bucket":{"terms":{"field":"cellular_network","size":500}},"clothing_type_bucket":{"terms":{"field":"clothing_type","size":500}},"color_bucket":{"terms":{"field":"color","size":500}},"size_bucket":{"terms":{"field":"size","size":500}}}}
'

My problem happens with Magento ver. 2.4.1 and ElasticSearch 7. Any insights on resolving this issue will be very appreciated.

magento2 – Filter on custom attributes – elasticsearch – not working on simple products

I have a project where I have a lot of configurable products and I need to make some filters there. I’ve manage to make the filters and everything related but the issue is that when I apply filters

Filters

I am getting that for size 34 there are 22 products in total and from those, there are 22 products with stock_custom filter on “In stock” and 18 with “Out of stock”. The “Out of stock” value is ok, but the “In stock” value is not because is showing me the total count of products and is not taking into consideration the size filter.

I want to mention that the size filter is the super attribute for configuration so it should get the simple products with “stock_custom” values.

What do I do wrong here?

magento2 – Your current search engine, ‘Elasticsearch 2’, is not supported

I just upgraded magento 2.3.5 to 2.4.1 . Its completed successfully and i did changed search engine form “mysql” to “elasticsearch” and now its showing error when i run : bin/magento setup:upgrade

Your current search engine, ‘Elasticsearch 2’, is not supported. You
must install a supported search engine before upgrading. See the
System Upgrade Guide for more information.

I have installed and configured elasticsearch like below :

{
  "name" : "test-pc",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "ixBumh5mSbSdZkxTFZNErg",
  "version" : {
    "number" : "7.10.1",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "1c34507e66d7db1211f66f3513706fdf548736aa",
    "build_date" : "2020-12-05T01:00:33.671820Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Anybody have any idea whats going wrong here ?

magento2 – configuring elasticsearch in 2.4.0

I installed magento 2.4.0 on sheared hosting with 1 click installation.

I understand that Magento 2.4.0 needs Elasticsearch to operate properly and I have set up an instance with AWS and I’m now trying and failing to configure my magento installation to connect to it.

I’ve entered the credentials into the back end but I’m still getting an error message about no active nodes on my cluster

elasticsearch – “should” query affect scoring, how to avoid that?

I would like to change the following ElasticSearch so the “should” array will not affect the scoring of the result. I want that the score will be calculated by the “query_string” for the name property only.

how can i achieve that with minimum code changes?

GET customers/_search
{
    "query": {
        "bool": {
            "must": (
                {
                    "query_string": {
                        "default_field": "properties.name",
                        "query": "Joe*"
                    }
                }
            ),
            "should": (                    
                {
                    "match": {
                        "properties.role": "admin"
                    }
                },
                {
                    "match": {
                        "properties.role": "sysop"
                    }
                },
                {
                    "match": {
                        "properties.role": "client"
                    }
                },
                {
                    "match": {
                        "properties.status": "public"
                    }
                },
                {
                    "match": {
                        "properties.status": "public"
                    }
                }
            ),
            "must_not": (
                {
                    "match": {
                        "properties.status": "hide_from_search_results"
                    }
                },
                {
                    "match": {
                        "properties.status": "deleted"
                    }
                },
                {
                    "match": {
                        "properties.status": "banned"
                    }
                },
                {
                    "match": {
                        "properties.status": "hide_from_search_results"
                    }
                },
                {
                    "match": {
                        "properties.status": "deleted"
                    }
                },
                {
                    "match": {
                        "properties.status": "banned"
                    }
                },
                {
                    "match": {
                        "properties.status": "hide_from_search_results"
                    }
                },
                {
                    "match": {
                        "properties.status": "deleted"
                    }
                },
                {
                    "match": {
                        "properties.status": "banned"
                    }
                }
            )
        }
    },
    "size": 30,
    "sort": (
        {
            "_score": {
                "order": "desc"
            }
        },
        {
            "_script": {
                "type": "string",
                "order": "desc",
                "script": {
                    "lang": "painless",
                    "source": "return doc('_index')(0) == 'customers' && doc.containsKey('properties.videoCount')?doc('properties.videoCount').value:0"
                }
            }
        },
        {
            "_script": {
                "type": "string",
                "order": "desc",
                "script": {
                    "lang": "painless",
                    "source": "long timestampNow = new Date().getTime(); return doc('_index')(0) == 'customers' && doc.containsKey('properties.subscriptions.features.allow-application')?(timestampNow < doc('properties.subscriptions.features.first-on-search').value.getMillis()):false"
                }
            }
        },
        {
            "_script": {
                "type": "string",
                "order": "desc",
                "script": {
                    "lang": "painless",
                    "source": "return doc('_index')(0) == 'customers' && doc.containsKey('properties.videoCount')?doc('properties.videoCount').value:0"
                }
            }
        }
    )
}

Is it possible to filter specific rabbitmq queues on metricbeat while indexing into Elasticsearch?

I’m using the RabbitMq module under metricbeat to index my topics and queues to Elasticsearch.

The rabbitmq queue metricset defines a few indexes such as: rabbitmq.queue.name, rabbitmq.queue.messages.total.count and so on, Is there a way to limit specific queues such that only the required queues index into ES without having to push all the topics, exchanges and queues?

This is the rabbitmq.yml file under the modules.d folder in Metricbeat:

metricbeat.modules:
- module: rabbitmq
  metricsets: ["node", "queue", "connection", "exchange"]
  enabled: true
  period: 10s
  hosts: ["localhost:15672"]
  #username: guest
  #password: guest

elasticsearch – Error al realizar una búsqueda (Liferay 7.1 GA)

he desarrollado un portal web en Liferay y todo funciona a la perfección a excepción de la barra de búsqueda de la página principal. Al introducir una palabra se realiza la consulta perfectamente y al hacer clic sobre algunos resultados no accede correctamente a ellos. Adjunto el error emergente.

Entonces, este error aparece al seleccionar un contenido web. ¿Como podría configurar la búsqueda para que no muestre contenidos web? ¿O cómo podría subsanar este error?

Muchas gracias de antemano y un saludo

introducir la descripción de la imagen aquí