3

I created multiple versions for my page. I see only last version in Search Results SXA component when page is rendered in normal mode (what is expected).

Although, when I switch to Preview mode, all the variants are shown.

How can I filter the data to render only the latest page version in Experince Editor Preview?

Reproduced in Sitecore Experience Accelerator 1.1 rev. 161004 for 8.2.

1 Answer 1

6

The reason you see only the latest version in normal mode is the fact that there is only one version in web database.

Normally Search Results rendering returns all versions of your item.

This is unexpected behaviour and I would consider this as a bug (by default we should get only the latest version, this is the default Sitecore behaviour).

SXA ticket for that has been created and the issue should be fixed in the next release.

What you can do for now?

This probably won't solve your problem because I don't think that there is a way to select distinct items based on some property within Sitecore search query but you can try.

You can filter your searach results with Search Scope.

  1. Navigate to tenant/site/settings/scopes
  2. Create new search scope item
  3. Build Sitecore query to filter you results (in this case I request only items with version number 1) enter image description here
  4. Assign your Search Scope to Search Results rendering enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.