Smile-SA / elasticsuite

Smile ElasticSuite - Magento 2 merchandising and search engine built on ElasticSearch
https://elasticsuite.io
Open Software License 3.0
761 stars 341 forks source link

Upgrade to Magento 2.4.5-p3 using OpenSearch 1.2 gets some errors #2985

Closed matiuskm closed 1 year ago

matiuskm commented 1 year ago

Upgrade to Magento 2.4.5-p3 using OpenSearch 1.2 gets some errors I get this error when trying to run indexer Element 'datasources': This element is not expected. Expected is ( mapping ).

If I remove the datasources attribute, it runs without error, but cannot create any searchable documents. I compare it with the older version, using ElasticSearch 5.6 the system can create 144,872 searchable documents, but after upgrade it using OpenSearch 1.2 it only creates 34 searchable documents.

Here is my elasticsuite_indices.xml `<indices xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Smile_ElasticsuiteCore:etc/elasticsuite_indices.xsd">

<index identifier="catalog_product" defaultSearchType="product">
    <type name="product" idFieldName="entity_id">
        <!-- <datasources>
            <datasource name="prices">WD\Elasticsearch\Model\Product\Indexer\Fulltext\Datasource\PriceData</datasource>
            <datasource name="categories">WD\Elasticsearch\Model\Product\Indexer\Fulltext\Datasource\CategoryData</datasource>
            <datasource name="attributes">WD\Elasticsearch\Model\Product\Indexer\Fulltext\Datasource\AttributeData</datasource>
            <datasource name="stock">WD\Elasticsearch\Model\Product\Indexer\Fulltext\Datasource\InventoryData</datasource>
            <datasource name="keywords">WD\Elasticsearch\Model\Product\Indexer\Fulltext\Datasource\KeywordData</datasource>
        </datasources> -->
        <mapping>
            <!-- Static fields handled by the base indexer (not datasource) -->
            <field name="entity_id" type="integer" />
            <field name="attribute_set_id" type="integer" />
            <field name="has_options" type="boolean" />
            <field name="required_options" type="boolean" />
            <field name="created_at" type="date" />
            <field name="updated_at" type="date" />
            <field name="approval_date" type="date" />
            <field name="type_id" type="keyword" />
            <field name="sku" type="string" />
            <field name="visibility" type="integer" />
            <field name="children_ids" type="integer" />
            <field name="configurable_attributes" type="keyword" />

            <!-- Static fields handled by the "prices" datasource -->
            <field name="price.price" type="double" nestedPath="price"/>
            <field name="price.original_price" type="double" nestedPath="price"/>
            <field name="price.is_discount" type="boolean" nestedPath="price"/>
            <field name="price.has_tier_price" type="boolean" nestedPath="price"/>
            <field name="price.has_sales" type="boolean" nestedPath="price"/>
            <field name="price.customer_group_id" type="integer" nestedPath="price"/>

            <!-- Static fields handled by the "stock" datasource -->
            <field name="stock.is_in_stock" type="boolean" />
            <field name="stock.qty" type="integer" />

            <!-- Static fields handled by the "prices" datasource -->
            <field name="category.category_id" type="integer" nestedPath="category" />
            <field name="category.position" type="integer" nestedPath="category" />
            <field name="category.is_parent" type="boolean" nestedPath="category" />
            <field name="category.name" type="keyword" nestedPath="category">
                <isSearchable>1</isSearchable>
                <isUsedInSpellcheck>1</isUsedInSpellcheck>
                <isFilterable>0</isFilterable>
            </field>

        </mapping>
    </type>
</index>

`

romainruaud commented 1 year ago

Hi @matiuskm

The datasources have been moved in 2.8.0 version : https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-catalog/etc/di.xml#L339

We had some backward compatibilities during some time but these have been removed.

So please move your datasources to di.xml file.

Regards

matiuskm commented 1 year ago

Hi @romainruaud

Thanks. Let me try it first.

matiuskm commented 1 year ago

Hi @romainruaud

still no luck, the searchable documents remain the same... do you have any suggestion how to fix this?

regards

romainruaud commented 1 year ago

Please give us more details about the version of all components (Magento, Elasticsuite).

Is this a website you're migrating from an older version ?

Regards

matiuskm commented 1 year ago

Current version: Magento CE 2.1.10, AWS Elastic Search 5.6, Elasticsuite 2.5 Upgrade to: Magento CE 2.4.5-p3, AWS OpenSearch 1.2, Elasticsuite 2.11

@romainruaud is this what you need?

regards

vahonc commented 1 year ago

@matiuskm,

You shouldn't use ElasticSuite 2.11 with Magento 2.4.5. Try to check again your datasorces definition if everything is correct, move it in di.xml, and use ElasticSuite 2.10.x.

Also, check your OpenSearch and Magento logs, maybe you will find some errors there.

BR, Vadym

matiuskm commented 1 year ago

hi @vahonc,

sorry for late reply, let me try using elasticsuite 2.10.x first

regards

matiuskm commented 1 year ago

hi @vahonc

after i downgrade the elasticsuite to 2.10.x version, and try to run the indexer, the result still the same.

image

and not found any error on magento log, neither in opensearch log as well...

regards

vahonc commented 1 year ago

@matiuskm,

According to your screenshot, it's strange that there is only ElasticSuite Category Index, but no other index like ElasticSuite Thesaurus Index. It could be not the reason for your issue but it can tell that maybe something wrong with the installation or configuration of the ElasticSute. Therefore, can you tell me how exactly you install the ElasticSuite, in other words via zip archive or Composer?

Also, you can enable logging ES queries in: Stores -> Configuration -> Elasticsuite -> Base settings -> Elasticsearch Client -> Enable Debug Mode and the queries that are being sent to ES when you are browsing categories will be logged into the system.log.

BR, Vadym

matiuskm commented 1 year ago

@vahonc

I was using the zip archive and only put ElasticsuiteCore, ElasticsuiteCatalog, ElasticsuiteCatalogRule, and ElasticsuiteVirtualCategory

Because in the previous code, by our previous developers, they even only use ElasticsuiteCore, I'm not really sure why they did that. So when I was assigned to upgrade the magento, I'm trying to follow what was there before and try not to change so many things massively.

But, if you think that's relevant with this case, I will try to copy all the module completely.

regards

romainruaud commented 1 year ago

Hi @matiuskm you should install via composer as per the Magento good practices.

We do not support installing with a zip archive either.

Regards

matiuskm commented 1 year ago

@romainruaud noted I will try that

regards

romainruaud commented 1 year ago

Can you enable the debug log of Elasticsuite now and check what you might have in the var/debug.log and var/system.log during the reindexing ?

Regards

matiuskm commented 1 year ago

I got very long log text regarding the reindexing, but no error found related to that process. everything works fine. should i paste it here?

romainruaud commented 1 year ago

Yes please paste this here.

Regards

matiuskm commented 1 year ago

I can't paste it here, since it's too long debug.log system.log

matiuskm commented 1 year ago

hi @romainruaud do you found anything from the log file?

regards

romainruaud commented 1 year ago

Hi @matiuskm

nope, I can see the category index being created, populated with bulk, and switched to the proper alias.

But for the products, I see the index being created, and then switched to the proper alias.

It's like no products are sent to this index.

Can you check what do you have at this line : https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Action/Full.php#L80

You should log the SQL query ($select->assemble()) and try to run it against your database.

There's probably an issue with your product visibility or the association between categories and products.

Btw, you should check that all your categories are is_anchor=1 in the database. This setting is hidden by Elasticsuite so that any newly created category is anchor by default, but if you imported them from an older system, you might miss this configuration.

Regards

matiuskm commented 1 year ago

Hi @romainruaud

sorry I cannot get the SQL query from that code... $logger = $this->objectManager->create('\Psr\Log\LoggerInterface'); $logger->info("SQL Query Elasticsuite: \n".$select->assemble());

is that the correct way? oh and is_anchor for all categories already set to 1

regards

romainruaud commented 1 year ago

Yes @matiuskm that's the way to log the SQL query.

Very strange if you have nothing, are you sure you are reaching this line when reindexing ?

Regards

matiuskm commented 1 year ago

Hi @romainruaud how to make sure? tried using echo nothing showed up.

regards

romainruaud commented 1 year ago

Maybe this class is overriden elsewhere ?

https://developer.adobe.com/commerce/php/development/build/dependency-injection-file/#get-dependency-injection-configuration-information-for-a-class

bin/magento dev:di:info "Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Indexer\Fulltext\Action\Full"

Maybe you should ensure also that Elasticsuite is defined as your search engine in "Stores > Configuration > Catalog > Catalog Search > Search Engine" (just in case).

Regards

matiuskm commented 1 year ago

Hi @romainruaud

after checking the codes, yes, it was overriden by a custom class. after i put the code to dump the query in that particular file, i got this... image

regards

romainruaud commented 1 year ago

it seems there is an exception but you don't have the whole stack (trimmed at 13)

Maybe you have more info in the exception.log or system.log ? maybe debug.log ?

Regards

matiuskm commented 1 year ago

Hi @romainruaud

i found this in system.log [2023-07-27T14:33:05.493058+00:00] main.INFO: Request Success: {"method":"HEAD","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com/","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":200,"duration":0.049014} [] [2023-07-27T14:33:05.493267+00:00] main.INFO: curl -XHEAD 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com/?pretty=true' [] [] [2023-07-27T14:33:05.534572+00:00] main.WARNING: Request Failure: {"method":"PUT","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product_20233327_14i05","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":400,"duration":0.031051,"error":"{\"error\":{\"root_cause\":[{\"type\":\"validation_exception\",\"reason\":\"Validation Failed: 1: this action would add [1] total shards, but this cluster currently has [1000]/[1000] maximum shards open;\"}],\"type\":\"validation_exception\",\"reason\":\"Validation Failed: 1: this action would add [1] total shards, but this cluster currently has [1000]/[1000] maximum shards open;\"},\"status\":400}"} [] [2023-07-27T14:33:05.534706+00:00] main.WARNING: Response ["{\"error\":{\"root_cause\":[{\"type\":\"validation_exception\",\"reason\":\"Validation Failed: 1: this action would add [1] total shards, but this cluster currently has [1000]/[1000] maximum shards open;\"}],\"type\":\"validation_exception\",\"reason\":\"Validation Failed: 1: this action would add [1] total shards, but this cluster currently has [1000]/[1000] maximum shards open;\"},\"status\":400}"] [] [2023-07-27T14:33:05.534774+00:00] main.INFO: curl -XPUT 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product_20233327_14i05?pretty=true' -d '{"settings":{"requests.cache.enable":true,"number_of_replicas":0,"number_of_shards":1,"refresh_interval":"30s","merge.scheduler.max_thread_count":1,"translog.durability":"async","codec":"best_compression","max_result_window":100000,"mapping.total_fields.limit":20000,"max_shingle_diff":9,"max_ngram_diff":18,"analysis":{"char_filter":{"html_strip":{"type":"html_strip"}},"filter":{"trim":{"type":"trim"},"truncate_to_max":{"type":"truncate","length":8192},"lowercase":{"type":"lowercase"},"word_delimiter":{"type":"word_delimiter","generate_word_parts":true,"catenate_words":true,"catenate_numbers":true,"catenate_all":true,"split_on_case_change":true,"split_on_numerics":true,"preserve_original":true},"shingle":{"type":"shingle","min_shingle_size":2,"max_shingle_size":4,"output_unigrams":false},"reference_shingle":{"type":"shingle","min_shingle_size":2,"max_shingle_size":10,"output_unigrams":true,"token_separator":""},"reference_word_delimiter":{"type":"word_delimiter","generate_word_parts":true,"catenate_words":false,"catenate_numbers":false,"catenate_all":false,"split_on_case_change":true,"split_on_numerics":true,"preserve_original":false},"ascii_folding":{"type":"asciifolding","preserve_original":false},"phonetic":{"type":"phonetic","encoder":"metaphone"},"edge_ngram_filter":{"type":"edge_ngram","min_gram":3,"max_gram":20},"stemmer":{"type":"stemmer","language":"english"}},"analyzer":{"keyword":{"tokenizer":"keyword","type":"custom","filter":["truncate_to_max"],"char_filter":[]},"standard":{"tokenizer":"standard","type":"custom","filter":["ascii_folding","trim","word_delimiter","lowercase","stemmer"],"char_filter":["html_strip"]},"whitespace":{"tokenizer":"standard","type":"custom","filter":["ascii_folding","trim","word_delimiter","lowercase"],"char_filter":["html_strip"]},"reference":{"tokenizer":"standard","type":"custom","filter":["ascii_folding","trim","reference_word_delimiter","lowercase","reference_shingle"],"char_filter":["html_strip"]},"shingle":{"tokenizer":"whitespace","type":"custom","filter":["ascii_folding","trim","word_delimiter","lowercase","stemmer","shingle"],"char_filter":["html_strip"]},"sortable":{"tokenizer":"keyword","type":"custom","filter":["ascii_folding","trim","lowercase"],"char_filter":["html_strip"]},"phonetic":{"tokenizer":"standard","type":"custom","filter":["ascii_folding","trim","word_delimiter","lowercase","phonetic"],"char_filter":["html_strip"]},"standard_edge_ngram":{"tokenizer":"standard","type":"custom","filter":["ascii_folding","trim","word_delimiter","lowercase","stemmer","edge_ngram_filter"],"char_filter":["html_strip"]}}}}}' [] []

and reindex process now showing different error than the last time. image

regards

romainruaud commented 1 year ago

Ok so your cluster is full.

have a look at : https://github.com/Smile-SA/elasticsuite/issues/3012

Please also give us the result of this command : curl http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com/_cat/indices if you're able to have it (might require credentials for the ES server).

Regards

matiuskm commented 1 year ago

Hi @romainruaud

here is the result indices.txt

regards

romainruaud commented 1 year ago

Ok so you can probably clean all of this.

curl -XDELETE http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com/dev_*

matiuskm commented 1 year ago

Hi @romainruaud

ok so now i get this error

Catalog Product Rule index has been rebuilt successfully in 00:00:00
Catalog Search index process error during indexation process:
Call to a member function select() on null
romainruaud commented 1 year ago

Do you have a more detailed stacktrace anywhere in your logs ? system.log or exception.log or debug.log ?

matiuskm commented 1 year ago

Hi @romainruaud

I already solved the previous problem. I am now able to increase the searchable documents from 34 to 8,128

but search product function still not returning any results yet. is there any way i can debug this?

regards

romainruaud commented 1 year ago

You can enable the elasticsuite debug log and check the queries you have in the system.log file

matiuskm commented 1 year ago

hi @romainruaud

ok i found it like this [2023-07-31T10:01:11.708211+00:00] main.INFO: Request Success: {"method":"HEAD","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":200,"duration":1.134639} [] [2023-07-31T10:01:11.708392+00:00] main.INFO: curl -XHEAD 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product?pretty=true' [] [] [2023-07-31T10:01:11.764101+00:00] main.INFO: Request Success: {"method":"GET","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product/_stats","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":200,"duration":0.04289} [] [2023-07-31T10:01:11.764432+00:00] main.INFO: curl -XGET 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product/_stats?pretty=true' [] [] [2023-07-31T10:01:12.116810+00:00] main.INFO: Request Success: {"method":"POST","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/_mtermvectors","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":200,"duration":0.350789} [] [2023-07-31T10:01:12.116982+00:00] main.INFO: curl -XPOST 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/_mtermvectors?pretty=true' -d '{"docs":[{"_index":"dev_default_catalog_product","_type":"_doc","term_statistics":true,"fields":["spelling","spelling.whitespace","search.whitespace"],"doc":{"search":"*","spelling":"*"},"routing":"[dev_default_catalog_product][0]"}]}' [] [] [2023-07-31T10:01:12.216775+00:00] main.INFO: Request Success: {"method":"POST","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_thesaurus/_analyze","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":200,"duration":0.094848} [] [2023-07-31T10:01:12.216949+00:00] main.INFO: curl -XPOST 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_thesaurus/_analyze?pretty=true' -d '{"text":"*","analyzer":"synonym"}' [] [] [2023-07-31T10:01:12.223961+00:00] main.INFO: Request Success: {"method":"POST","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_thesaurus/_analyze","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":200,"duration":0.006599} [] [2023-07-31T10:01:12.224119+00:00] main.INFO: curl -XPOST 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_thesaurus/_analyze?pretty=true' -d '{"text":"*","analyzer":"expansion"}' [] [] [2023-07-31T10:01:12.239666+00:00] main.INFO: Request Success: {"method":"GET","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com/","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":200,"duration":0.005746} [] [2023-07-31T10:01:12.239844+00:00] main.INFO: curl -XGET 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com/?pretty=true' [] [] [2023-07-31T10:01:12.245097+00:00] main.INFO: Request Success: {"method":"GET","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com/","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":200,"duration":0.004949} [] [2023-07-31T10:01:12.245247+00:00] main.INFO: curl -XGET 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com/?pretty=true' [] [] [2023-07-31T10:01:12.674969+00:00] main.INFO: Request Success: {"method":"POST","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product/_search","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":200,"duration":0.429188} [] [2023-07-31T10:01:12.675151+00:00] main.INFO: curl -XPOST 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product/_search?pretty=true' -d '{"size":0,"query":{"bool":{"filter":{"bool":{"must":[{"term":{"stock.is_in_stock":{"value":true,"boost":1}}},{"terms":{"visibility":[3,4],"boost":1}},{"terms":{"option_text_type.untouched":["wine"],"boost":1}},{"terms":{"type_id":["simple"],"boost":1}},{"terms":{"option_text_status.standard":["1"],"boost":1}},{"range":{"stock.qty":{"gt":"0","boost":1}}}],"must_not":[],"should":[],"boost":1}},"must":{"multi_match":{"query":"*","fields":["search.whitespace^1","name.whitespace^10","sku.whitespace^6","option_text_type.whitespace^3","producer.whitespace^8","option_text_grape_varieties.whitespace^5","option_text_country.whitespace^3","option_text_region.whitespace^5"],"minimum_should_match":"100%","tie_breaker":1.0,"boost":1,"type":"best_fields"}},"boost":1}},"aggregations":{"attribute_set_id":{"terms":{"field":"attribute_set_id","size":10000,"order":{"_count":"desc"}}},"indexed_attributes":{"terms":{"field":"indexed_attributes","size":10000,"order":{"_count":"desc"}}}},"track_total_hits":true}' [] [] [2023-07-31T10:01:13.027671+00:00] main.INFO: Request Success: {"method":"POST","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product/_search","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":200,"duration":0.320279} [] [2023-07-31T10:01:13.027868+00:00] main.INFO: curl -XPOST 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product/_search?pretty=true' -d '{"size":36,"sort":[{"_score":{"order":"desc"}},{"entity_id":{"order":"desc","missing":"_first","unmapped_type":"keyword"}}],"from":792,"query":{"bool":{"filter":{"bool":{"must":[{"term":{"stock.is_in_stock":{"value":true,"boost":1}}},{"terms":{"visibility":[3,4],"boost":1}},{"terms":{"option_text_type.untouched":["wine"],"boost":1}},{"terms":{"type_id":["simple"],"boost":1}},{"terms":{"option_text_status.standard":["1"],"boost":1}},{"range":{"stock.qty":{"gt":"0","boost":1}}}],"must_not":[],"should":[],"boost":1}},"must":{"multi_match":{"query":"*","fields":["search.whitespace^1","name.whitespace^10","sku.whitespace^6","option_text_type.whitespace^3","producer.whitespace^8","option_text_grape_varieties.whitespace^5","option_text_country.whitespace^3","option_text_region.whitespace^5"],"minimum_should_match":"100%","tie_breaker":1.0,"boost":1,"type":"best_fields"}},"boost":1}},"aggregations":{"attribute_set_id":{"terms":{"field":"attribute_set_id","size":10000,"order":{"_count":"desc"}}},"indexed_attributes":{"terms":{"field":"indexed_attributes","size":10000,"order":{"_count":"desc"}}},"categories":{"filters":{"filters":{"142":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["142"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"144":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["144"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"146":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["146"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"150":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["150"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"151":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["151"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"152":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["152"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"163":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["163"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"164":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["164"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"172":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["172"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"174":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["174"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"175":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["175"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"178":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["178"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"181":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["181"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"185":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["185"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"191":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["191"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"200":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["200"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"201":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["201"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"202":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["202"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"203":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["203"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"205":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["205"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"207":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["207"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"209":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["209"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"210":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["210"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"211":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["211"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"214":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["214"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"219":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["219"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"220":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["220"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"221":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["221"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"229":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["229"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"233":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["233"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"234":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["234"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"238":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["238"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"244":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["244"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}}}}}},"track_total_hits":true}'

romainruaud commented 1 year ago

You're searching for "*" ? It's unlikely to work, the query seems well-formed btw.

If you search for a string that is contained in your product names, does it work ?

matiuskm commented 1 year ago

I actually search for a specific product type, but i'm not sure which part of the code that allow me to do so.

here is my search criteria builder code ` /**

romainruaud commented 1 year ago

In such a specific use case, I'm not sure you should use the quick_search_container, especially if you're not searching for any text. Most probably there is a Magento magic somewhere that does inject "*" automatically if there is no search string provided.

You might try to use catalog_view_container instead.

matiuskm commented 1 year ago

oh i have this log from the current system in this case, i would like to search products using "melon" keyword

Request Body {"0":"{\"size\":10,\"sort\":[{\"_score\":{\"order\":\"desc\"}},{\"entity_id\":{\"order\":\"desc\",\"missing\":\"_first\",\"unmapped_type\":\"keyword\"}}],\"from\":0,\"query\":{\"bool\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"type_id\":[\"simple\"],\"boost\":1}},{\"terms\":{\"status\":[\"1\"],\"boost\":1}},{\"range\":{\"stock.qty\":{\"gt\":\"0\",\"boost\":1}}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"must\":{\"bool\":{\"must\":[],\"must_not\":[],\"should\":[{\"query_string\":{\"default_field\":\"name\",\"query\":\"melon~\",\"fuzziness\":\"AUTO\",\"boost\":500}},{\"query_string\":{\"default_field\":\"name\",\"query\":\"*melon*~\",\"fuzziness\":\"AUTO\",\"boost\":100}},{\"query_string\":{\"default_field\":\"name\",\"query\":\"melon\",\"fuzziness\":\"AUTO\",\"boost\":1000}},{\"query_string\":{\"default_field\":\"producer\",\"query\":\"melon~\",\"fuzziness\":\"AUTO\",\"boost\":1000}},{\"query_string\":{\"default_field\":\"option_text_country\",\"query\":\"melon~\",\"fuzziness\":\"AUTO\",\"boost\":500}},{\"query_string\":{\"default_field\":\"option_text_country\",\"query\":\"melon\",\"fuzziness\":\"AUTO\",\"boost\":1000}},{\"query_string\":{\"default_field\":\"option_text_region\",\"query\":\"melon~\",\"fuzziness\":\"AUTO\",\"boost\":500}},{\"query_string\":{\"default_field\":\"option_text_region\",\"query\":\"melon\",\"fuzziness\":\"AUTO\",\"boost\":1000}},{\"query_string\":{\"default_field\":\"option_text_type\",\"query\":\"melon~\",\"fuzziness\":\"AUTO\",\"boost\":500}},{\"query_string\":{\"default_field\":\"option_text_type\",\"query\":\"*melon*~\",\"fuzziness\":\"AUTO\",\"boost\":100}},{\"query_string\":{\"default_field\":\"option_text_grape_varieties\",\"query\":\"melon~\",\"fuzziness\":\"AUTO\",\"boost\":500}},{\"query_string\":{\"default_field\":\"option_text_grape_varieties\",\"query\":\"melon\",\"fuzziness\":\"AUTO\",\"boost\":1000}},{\"query_string\":{\"default_field\":\"description\",\"query\":\"melon~\",\"fuzziness\":\"AUTO\",\"boost\":1}},{\"query_string\":{\"default_field\":\"short_description\",\"query\":\"melon~\",\"fuzziness\":\"AUTO\",\"boost\":1}},{\"query_string\":{\"default_field\":\"scan_keywords\",\"query\":\"melon~\",\"fuzziness\":\"AUTO\",\"boost\":500}}],\"minimum_should_match\":1,\"boost\":1}},\"boost\":1}},\"aggs\":{\"type_id\":{\"terms\":{\"field\":\"type\",\"size\":1000}},\"grape_varieties_id\":{\"terms\":{\"field\":\"grape_varieties\",\"size\":1000}},\"country_id\":{\"terms\":{\"field\":\"country\",\"size\":1000}},\"region_id\":{\"terms\":{\"field\":\"region\",\"size\":1000}},\"bottle_size_group\":{\"range\":{\"field\":\"bottle_size\",\"ranges\":[{\"key\":\"0-375\",\"from\":0,\"to\":375},{\"key\":\"375\",\"from\":375,\"to\":376},{\"key\":\"375-750\",\"from\":376,\"to\":750},{\"key\":\"750\",\"from\":750,\"to\":751},{\"key\":\"750-1500\",\"from\":751,\"to\":1500},{\"key\":\"1500\",\"from\":1500,\"to\":1501},{\"key\":\"1500-99999\",\"from\":1501,\"to\":99999}]}},\"price\":{\"nested\":{\"path\":\"price\"},\"aggs\":{\"max_price\":{\"max\":{\"field\":\"price.price\"}},\"min_price\":{\"min\":{\"field\":\"price.price\"}}}},\"has_sales\":{\"nested\":{\"path\":\"price\"},\"aggs\":{\"has_sales\":{\"terms\":{\"field\":\"price.has_sales\",\"size\":1000}}}}}}","is_exception":false}

and this one is from the upgraded version Request Body ["{\"size\":10,\"sort\":[{\"_score\":{\"order\":\"desc\"}},{\"entity_id\":{\"order\":\"desc\",\"missing\":\"_first\",\"unmapped_type\":\"keyword\"}}],\"from\":0,\"query\":{\"bool\":{\"filter\":{\"bool\":{\"must\":[{\"term\":{\"stock.is_in_stock\":{\"value\":true,\"boost\":1}}},{\"terms\":{\"visibility\":[3,4],\"boost\":1}},{\"terms\":{\"type_id\":[\"simple\"],\"boost\":1}},{\"terms\":{\"option_text_status.standard\":[\"1\"],\"boost\":1}},{\"range\":{\"stock.qty\":{\"gt\":\"0\",\"boost\":1}}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"must\":{\"bool\":{\"filter\":{\"multi_match\":{\"query\":\"melon\",\"fields\":[\"search^1\",\"sku^1\"],\"minimum_should_match\":\"100%\",\"tie_breaker\":1,\"boost\":1,\"type\":\"best_fields\",\"cutoff_frequency\":0.15}},\"must\":{\"multi_match\":{\"query\":\"melon\",\"fields\":[\"search^1\",\"name.standard^10\",\"sku.reference^6\",\"option_text_type.standard^3\",\"producer.standard^8\",\"option_text_grape_varieties.standard^5\",\"option_text_country.standard^3\",\"option_text_region.standard^5\",\"search.whitespace^10\",\"name.whitespace^100\",\"sku.whitespace^60\",\"option_text_type.whitespace^30\",\"producer.whitespace^80\",\"option_text_grape_varieties.whitespace^50\",\"option_text_country.whitespace^30\",\"option_text_region.whitespace^50\",\"name.sortable^200\",\"sku.sortable^120\"],\"minimum_should_match\":1,\"tie_breaker\":1.0,\"boost\":1,\"type\":\"best_fields\",\"cutoff_frequency\":0.15}},\"boost\":1}},\"boost\":1}},\"aggregations\":{\"attribute_set_id\":{\"terms\":{\"field\":\"attribute_set_id\",\"size\":10000,\"order\":{\"_count\":\"desc\"}}},\"indexed_attributes\":{\"terms\":{\"field\":\"indexed_attributes\",\"size\":10000,\"order\":{\"_count\":\"desc\"}}},\"categories\":{\"filters\":{\"filters\":{\"142\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"142\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"144\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"144\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"146\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"146\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"150\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"150\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"151\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"151\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"152\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"152\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"163\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"163\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"164\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"164\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"172\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"172\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"174\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"174\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"175\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"175\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"178\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"178\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"181\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"181\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"185\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"185\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"191\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"191\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"200\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"200\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"201\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"201\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"202\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"202\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"203\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"203\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"205\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"205\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"207\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"207\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"209\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"209\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"210\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"210\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"211\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"211\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"214\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"214\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"219\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"219\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"220\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"220\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"221\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"221\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"229\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"229\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"233\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"233\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"234\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"234\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"238\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"238\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}},\"244\":{\"nested\":{\"path\":\"category\",\"score_mode\":\"none\",\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must_not\":[{\"term\":{\"category.is_virtual\":{\"value\":true,\"boost\":1}}}],\"boost\":1}},{\"terms\":{\"category.category_id\":[\"244\"],\"boost\":1}}],\"must_not\":[],\"should\":[],\"boost\":1}},\"boost\":1}}}}}},\"track_total_hits\":true}"] []

matiuskm commented 1 year ago

In such a specific use case, I'm not sure you should use the quick_search_container, especially if you're not searching for any text. Most probably there is a Magento magic somewhere that does inject "*" automatically if there is no search string provided.

You might try to use catalog_view_container instead.

could you elaborate this? i honestly doesn't understand ES at all.

romainruaud commented 1 year ago
$searchCriteria->setRequestName('quick_search_container');

This should be replaced by :

$searchCriteria->setRequestName('catalog_view_container');

You should use "quick_search_container" only if you plan to search for textual matching, which is not your case.

Regards

matiuskm commented 1 year ago

I have tried your suggestion, here's the log file.

[2023-08-08T01:37:53.389196+00:00] main.INFO: Request Success: {"method":"HEAD","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":200,"duration":0.426317} [] [2023-08-08T01:37:53.389392+00:00] main.INFO: curl -XHEAD 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product?pretty=true' [] [] [2023-08-08T01:37:53.430669+00:00] main.INFO: Request Success: {"method":"GET","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com/","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":200,"duration":0.006516} [] [2023-08-08T01:37:53.430860+00:00] main.INFO: curl -XGET 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com/?pretty=true' [] [] [2023-08-08T01:37:53.436487+00:00] main.INFO: Request Success: {"method":"GET","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com/","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":200,"duration":0.005241} [] [2023-08-08T01:37:53.436779+00:00] main.INFO: curl -XGET 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com/?pretty=true' [] [] [2023-08-08T01:37:53.450857+00:00] main.INFO: Request Success: {"method":"POST","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product/_search","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":200,"duration":0.01332} [] [2023-08-08T01:37:53.451034+00:00] main.INFO: curl -XPOST 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product/_search?pretty=true' -d '{"size":0,"query":{"bool":{"filter":{"bool":{"must":[{"term":{"stock.is_in_stock":{"value":true,"boost":1}}},{"terms":{"visibility":[2,4],"boost":1}},{"bool":{"must_not":[{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"term":{"category.category_id":{"value":2,"boost":1}}},{"term":{"category.is_blacklisted":{"value":true,"boost":1}}}],"must_not":[],"should":[],"boost":1}},"boost":1}}],"boost":1}},{"terms":{"option_text_type.untouched":["wine"],"boost":1}},{"terms":{"type_id":["simple"],"boost":1}},{"terms":{"option_text_status.standard":["1"],"boost":1}},{"range":{"stock.qty":{"gt":"0","boost":1}}}],"must_not":[],"should":[],"boost":1}},"must":{"multi_match":{"query":"*","fields":["search.whitespace^1","name.whitespace^10","sku.whitespace^6","option_text_type.whitespace^3","producer.whitespace^8","option_text_grape_varieties.whitespace^5","option_text_country.whitespace^3","option_text_region.whitespace^5"],"minimum_should_match":"100%","tie_breaker":1.0,"boost":1,"type":"best_fields"}},"boost":1}},"aggregations":{"attribute_set_id":{"terms":{"field":"attribute_set_id","size":10000,"order":{"_count":"desc"}}},"indexed_attributes":{"terms":{"field":"indexed_attributes","size":10000,"order":{"_count":"desc"}}}},"track_total_hits":true}' [] [] [2023-08-08T01:37:53.479384+00:00] main.INFO: Request Success: {"method":"POST","uri":"http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product/_search","port":"80","headers":{"Host":["vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (Linux 5.15.0-1040-aws; PHP 8.1.18)"],"x-elastic-client-meta":["es=7.17.1,php=8.1.18,t=7.17.1,a=0,cu=7.68.0"]},"HTTP code":200,"duration":0.025305} [] [2023-08-08T01:37:53.479709+00:00] main.INFO: curl -XPOST 'http://vpc-devwd-qecygyiaxmktilbkv64blntmxe.ap-southeast-1.es.amazonaws.com:80/dev_default_catalog_product/_search?pretty=true' -d '{"size":36,"sort":[{"category.position":{"order":"asc","missing":"_last","unmapped_type":"keyword","nested":{"path":"category","filter":{"terms":{"category.category_id":["2"],"boost":1}}},"mode":"min"}},{"_score":{"order":"desc"}},{"entity_id":{"order":"desc","missing":"_first","unmapped_type":"keyword"}}],"from":0,"query":{"bool":{"filter":{"bool":{"must":[{"term":{"stock.is_in_stock":{"value":true,"boost":1}}},{"terms":{"visibility":[2,4],"boost":1}},{"bool":{"must_not":[{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"term":{"category.category_id":{"value":2,"boost":1}}},{"term":{"category.is_blacklisted":{"value":true,"boost":1}}}],"must_not":[],"should":[],"boost":1}},"boost":1}}],"boost":1}},{"terms":{"option_text_type.untouched":["wine"],"boost":1}},{"terms":{"type_id":["simple"],"boost":1}},{"terms":{"option_text_status.standard":["1"],"boost":1}},{"range":{"stock.qty":{"gt":"0","boost":1}}}],"must_not":[],"should":[],"boost":1}},"must":{"multi_match":{"query":"*","fields":["search.whitespace^1","name.whitespace^10","sku.whitespace^6","option_text_type.whitespace^3","producer.whitespace^8","option_text_grape_varieties.whitespace^5","option_text_country.whitespace^3","option_text_region.whitespace^5"],"minimum_should_match":"100%","tie_breaker":1.0,"boost":1,"type":"best_fields"}},"boost":1}},"aggregations":{"attribute_set_id":{"terms":{"field":"attribute_set_id","size":10000,"order":{"_count":"desc"}}},"indexed_attributes":{"terms":{"field":"indexed_attributes","size":10000,"order":{"_count":"desc"}}},"categories":{"filters":{"filters":{"142":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["142"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"144":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["144"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"146":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["146"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"150":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["150"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"151":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["151"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"152":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["152"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"163":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["163"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"164":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["164"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"172":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["172"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"174":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["174"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"175":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["175"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"178":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["178"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"181":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["181"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"185":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["185"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"191":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["191"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"200":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["200"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"201":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["201"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"202":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["202"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"203":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["203"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"205":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["205"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"207":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["207"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"209":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["209"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"210":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["210"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"211":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["211"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"214":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["214"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"219":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["219"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"220":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["220"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"221":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["221"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"229":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["229"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"233":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["233"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"234":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["234"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"238":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["238"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"244":{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["244"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}}}}}},"track_total_hits":true}' [] []

and still no result

romainruaud commented 1 year ago

Hmm... I still see multi_match":{"query":"*" ...

So it's not surprising that you have no results :(

I suggest you try to find where this `*``comes from, I'll try to have a look in the elasticsuite/magento codebase but I don't remember seeing this previously so I suspect this is coming from your project.

Regards

matiuskm commented 1 year ago

but what makes me curious is, why did it work at first, and failed after i try to upgrade magento and all the plugins?

romainruaud commented 1 year ago

https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-core/Model/Search/RequestBuilder.php#L179

You are probably specifying somewhere that search_term = '*'.

According to your code, probably SearchWine::Q => self::SEARCH_TERM,

You should not send search_term if the value is empty or *.

Regards

matiuskm commented 1 year ago

is there anything to do with this configurations? configurations

and for your info, if i use these configurations, it somehow gave me errors (i forgot during the compilation, reindex process or during search process)... therefore, in elasticsuite_indices.xml i change type="string" into type="keyword" and in di.xml i have to delete these lines, or else it will failed (i forgot during the compilation or

<preference for="Magento\CatalogSearch\Model\Indexer\Fulltext\Action\FullFactory" type="WD\Elasticsearch\Model\Product\Indexer\Fulltext\Action\FullFactory" />

`<virtualType name="Magento\CatalogSearch\Model\ResourceModel\Fulltext\SearchCollection" type="WD\Elasticsearch\Model\ResourceModel\Product\Fulltext\Collection">

quick_search_container
</virtualType>`

<preference for="Magento\Catalog\Model\Indexer\Category\Product\Action\Full" type="WD\Elasticsearch\Model\Category\Indexer\Product\Action\Full" />

romainruaud commented 1 year ago

Remove your elasticsuite_indices.xml file, it's useless, it's a copy-paste from a very old version. And yes, "string" type does not exist anymore in Elasticsearch, it has been replaced by keyword.

I don't understand your di.xml file, it looks like many classes have been rewritten, and many that should not be rewritten except if you really know what you're doing.

I would suggest to remove those rewrites :

All of this looks like poor copy-paste of existing Elasticsuite classes. All those rewrites are possibly also a copy-paste of very old Elasticsuite version.

I suggest you stick to native Magento and Elasticsuite if you don't know exactly whas was the purpose of all those rewrites.

I'm closing your issue. I'm sorry but I've engaged way more than we should as part of Open Source support policy here.

It's clear that your issue is caused by a lot of customizations on top of Elasticsuite, and therefore not applicable for free help here.

If you're interested in paid support, contact us via elasticsuite@smile.fr

Regards.