Forum

Thread tagged as: Question, Problem, Configuration

Excluding template fields from Perch Search

I have some template fields in a region I'd rather not include in a Perch Search.

Can I exclude individual template fields from Search?

David Owen

David Owen 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

No, but that's an interesting thought. Could you give an example?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Would this work?

<perch:content id="something_internal" type="text" searchable="false" />

It's using my other two page list and detail example.

I was thinking of adding some extra meta information like "page description" and "keywords" as well as a general product description. And I thought more than likely the client would add to much repeated general information that might muddy the search results...

Having certain id's to exclude or therefore pin-point others perhaps would make Perch search a bit sharper.

Also seeing I can't search to return the URL "/shop.php?s={slug}&p={mysecondslug}" (which would be a better benefit first) it's not helping here - but I see it could in some situations.

Drew McLellan said:

Would this work?

<perch:content id="something_internal" type="text" searchable="false" />

Do you mean this would be something for a possible future? Then yes.

...actually it would be really good to have this,

I'm collecting some variables, "price options" and "price calculators" which are hidden and used for php to calculate stuff down the line.

These are returned in a search which should be ideally be hidden to a user.

Could searchable="false" be added?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It just has been. :)

That's great. Thanks!

searchable="false" seems to have no effect on my regions, WITH the most up to date version of Perch.

Because of this, several fields such as color hex codes (input type="color") and html class names are being shown in search results... any advice?