Stars in search results can be indexed using two different kind of properties:
review must be used if the post (or page) is a review.
The author gives a vote according to his judgment and this vote will be shown in search results like this:
To accomplish this, in YASR you have to select “yes” in reply to the question “ Is this a review? ” below the page editor, and give a vote using the yasr_overall_rating feature.
With YASR, you can achieve this by using yasr_visitor_votes shortcode, and select “no” in reply to the question “Is this a review?”.
You will notice that if you select review and then test the page with Structured Data Testing Tool with some schema itemType (e.g., product) this warning will appear:
The aggregateRating field is recommended. Please provide a value if available.
After a lot of tests, I noticed that if both aggregateRating and review are in the same page, google will index it with aggregateRating.
So, you should just ignore that warning if you want to index your page with review itemType.