0

I have a site on EE 3.5.17. I am using the basic search feature provided and have a template which outputs results as follows:

{exp:search:search_results}
    <h4><a href="{auto_path}">{title}</a></h4>
    <p>{excerpt}</p>
{/exp:search:search_results}

When I do certain searches I get a URL to images (and sometimes other resources like PDF's) in place of {excerpt}. For example the output might be:

<h4><a href="https://example.com/whitepaper/foo">Whitepaper: Foo</a></h4>
<p>https://example.com/pdf/foo.pdf</p>

When I visit these pages there is more on them than just a downloadable PDF. For example the structure of the page above (/whitepaper/foo) contains a <h1>, followed by a couple of paragraphs of text, and finally a downloadable file (/pdf/foo.pdf).

I can't see any way to override what the search facility uses as the {excerpt}. Is this possible?

Furthermore, the search results appear in a seemingly random - and not at all useful - order.

We are not upgrading this particular site to EE 4.x, and I don't know if the search in that is any better?

On a previous version of this site we used Google Site Search (i.e. where you have a form that scrapes results from Google for our domain, search-term site:example.com) but it looks like this has been discontinued.

Please can someone advise on how they've dealt with this situation as I imagine it's quite common.

1 Answer 1

2

You should check your channel's settings for "Search excerpt". That lets you define a field from which to pull the excerpt.

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.