Wix Site Search how to search only products

I added a wix site search to my website and I want it to search only products. However, it shows results for pages too. Is there a way to get rid of that and display only products?

If you are talking about the Wix Site Search app.
https://support.wix.com/en/article/about-wix-site-search

https://www.wix.com/corvid/reference/wix-search.html
Build and perform a search and display the results in a repeater
This example demonstrates how to set up a search for store products and display the results in a repeater. Each button in the repeater links to the product page for the selected product.

import wixSearch from 'wix-search';

// ...

// Before search runs, set the repeater data as empty
$w('#repeater').data = [];

$w("#searchInput").onKeyPress((keyPress) => {
  if (keyPress.key === "Enter") {
    const phrase = $w("#searchInput").value;
    wixSearch.search(phrase)
      .documentType("Stores/Products")
      .find()
      .then((results) => {
        if (results.documents.length > 0) {
          $w('#repeater').data = results.documents;
        } else {
          console.log("No matching results");
        }
      })
      .catch((error) => {
        console.log(error);
      });
  }
});

$w("#repeater").onItemReady(($item, itemData) => {
  $item("#title").text = itemData.title;
  $item("#description").text = itemData.description;
  $item("#image").src = itemData.image;
  $item("#button").link = itemData.url;
});

I did add the wix site search app, and I was wondering if there’s a way to display only products instead of display searched pages and products. I do not want the pages to be displayed. Is there a way? Also, is there a way to make the images of the searched products to fit instead of cropped?

You can’t change the Wix Site Search to the degree that you are wanting.

https://www.wix.com/corvid/reference/wix-search.html
To enable Search API functionality for your site, you must add the Wix Site Search application to your site. After installing the app you can delete the Search Bar, but make sure to leave the Search Results page on your site. Note that you cannot use the Search API to control the Wix Search Bar or Search Results page.

As for the images, you can look at using fitMode.
https://www.wix.com/corvid/reference/$w.Image.html#fitMode

The images are in a product gallery and I am using $w ( “Image” ). fitMode = “fixedWidth” ; to make the images of the search results page to fit, but the images still don’t change to fit from crop. I added that code to site code instead of page code. Does anyone know what might be causing this?

EDIT: I tried to console.log($w(“Image”)) but that doesn’t return anything, which means it’s not getting any of the images on the page. I used that code inside $w.onReady

If you are trying to change the images shown on Wix Site Search app own results page, then you can’t do that as it is a closed app.

You will only be able to do it on your own images, so make up your own search using the examples in the Corvid examples and setup up your own repeater to show your results.

If possible could you give a specific example from the Wix Stores section, I couldn’t find something there calling wixSearch.search()