Forum

Thread tagged as: Question

Search Excerpt Field

Is there a way of telling search what field in the region to grab the excerpt from when doing a search? As at the moment it merges from all fields so I end up with sentences that make no sense

Or is there an attribute to add to content templates that excludes the field from search results?

Dexter Harrison

Dexter Harrison 14 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You should be able to use your other fields in the search result if you don't like the excerpt.

Yeah I did that but the chars attribute wouldn't work on the field, so I ended up with really long excerpt

Drew McLellan

Drew McLellan 2638 points
Perch Support

Should do - show us your code.

Sure this is the part of the template

<perch:if exists="text"><perch:search id="text" encode="false" chars="200" /></perch:if>

Screenshot here shows more than 200 chars

chars

Drew McLellan

Drew McLellan 2638 points
Perch Support

You're missing the type attribute

type="textarea"

Oh yeah, silly me fixed it thank you