Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Product Display after installing Vendure ElasticSearchPlugin #155

Open
ashishkpaul opened this issue Apr 16, 2024 · 5 comments
Open

Comments

@ashishkpaul
Copy link
Contributor

Hi @gioboa, On Verndure v2.1.9 or v2.2.0 server side, I disable defaultSearchPlugin, then configure ElasticSearchPlugin with basic config options as:

ElasticsearchPlugin.init({
    host: 'http://localhost',
    port: 9200,
    bufferUpdates: false,
}),

then re-index the products, and it's displaying only 10 products from either root or child collections, instead of showing the total list of products present in a collection on the storefront.

GQL query:

query GetProductsInCollections {
    collections {
        items {                
            name
            slug
            parent {
                name
            }
            productVariants {
                totalItems
            }
        }
    }
}

The result is:

{
  "data": {
    "collections": {
      "items": [
        {
          "name": "Electronics",
          "slug": "electronics",
          "parent": {
            "name": "__root_collection__"
          },
          "productVariants": {
            "totalItems": 34
          }
        },
        {
          "name": "Computers",
          "slug": "computers",
          "parent": {
            "name": "Electronics"
          },
          "productVariants": {
            "totalItems": 25
          }
        },
        {
          "name": "Furniture",
          "slug": "furniture",
          "parent": {
            "name": "Home & Garden"
          },
          "productVariants": {
            "totalItems": 13
          }
        },
        {
          "name": "Equipment",
          "slug": "equipment",
          "parent": {
            "name": "Sports & Outdoor"
          },
          "productVariants": {
            "totalItems": 8
          }
        },
        {
          "name": "Camera & Photo",
          "slug": "camera-photo",
          "parent": {
            "name": "Electronics"
          },
          "productVariants": {
            "totalItems": 9
          }
        },
        {
          "name": "Home & Garden",
          "slug": "home-garden",
          "parent": {
            "name": "__root_collection__"
          },
          "productVariants": {
            "totalItems": 22
          }
        },
        {
          "name": "Plants",
          "slug": "plants",
          "parent": {
            "name": "Home & Garden"
          },
          "productVariants": {
            "totalItems": 9
          }
        },
        {
          "name": "Footwear",
          "slug": "footwear",
          "parent": {
            "name": "Sports & Outdoor"
          },
          "productVariants": {
            "totalItems": 24
          }
        },
        {
          "name": "Sports & Outdoor",
          "slug": "sports-outdoor",
          "parent": {
            "name": "__root_collection__"
          },
          "productVariants": {
            "totalItems": 32
          }
        }
      ]
    }
  }
}
@ashishkpaul
Copy link
Contributor Author

Both server and storefront are fresh installed

@ashishkpaul
Copy link
Contributor Author

Hi @gioboa,

I've cross-verified with the Remix storefront. With the same setup, all products in a collection are displaying in Remix, but not in Qwik storefront. Thanks for your assistance in advance.

See this video for reference

@gioboa
Copy link
Collaborator

gioboa commented Apr 18, 2024

Vendure features are a bit out of my knowledge. I tag @michaelbromley, for sure he will have a good answer

@michaelbromley
Copy link
Member

Hi @ashishkpaul I think this may be because the Elasticsearch plugin defaults to take: 10 if no explicit take argument is passed to the search query:

https://github.com/vendure-ecommerce/vendure/blob/0441a0338aeb7742012e24594feb67935d09b2fc/packages/elasticsearch-plugin/src/build-elastic-body.ts#L136

@ashishkpaul
Copy link
Contributor Author

ashishkpaul commented Jul 31, 2024

Basically, in qwik storefront, needs to add pagination logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants