Welcome! Log In Create A New Profile

Advanced

"show an extract from the page text" shows 2-3 words only

Posted by test-sphider 
"show an extract from the page text" shows 2-3 words only
December 22, 2011 06:15PM
Hello everybody.

In setting panel when I tick off "Show meta description in results page if it exists, otherwise show an extract from the page text." part, I get results that show a few words only.

When it shows a meta description, user cannot find the word in page description part because it only shows meta part of the page. So, I'd like to show an extract part of the page instead but I'd like it to show Maximum length of page summary to be 200 as in case of showing meta desc.
Re: "show an extract from the page text" shows 2-3 words only
December 23, 2011 01:20PM
You can set the length of the description in your Admin Panel => Settings => Search settings => Maximum length of page summary displayed in search results.

Or is that not what you are asking for?
Re: "show an extract from the page text" shows 2-3 words only
December 23, 2011 06:14PM
Thanks Willy,

But it is working if you activate "Show meta description in results page". I'd like to activate "show extract from the page text." option as this shows the query word and highlights it. But even I select 200 as length, results shows only a few words not 200 length.
Re: "show an extract from the page text" shows 2-3 words only
December 23, 2011 06:57PM
Sphider can only show as many words as there are present in the page content.
Meta description tag is not part of the content.

I understand you want to make a combination of meta description and content.

Correct?
Re: "show an extract from the page text" shows 2-3 words only
December 23, 2011 08:03PM
I want it to show an extract from the page text. Because it takes the part which includes the query, hence highlights the word. But it only shows a total of few words from the page, not 200 characters (off course that "few words" contains the query). Could you please change your settings and have a look at the results pages, test it yourself?
Re: "show an extract from the page text" shows 2-3 words only
December 24, 2011 07:18AM
It works fine for me, it shows the number of characters I set in the admin panel.
Re: "show an extract from the page text" shows 2-3 words only
December 26, 2011 03:40PM
when I select "Show meta description in results page if it exists, otherwise show an extract from the page text." it shows exactly 200 chars as I set in settings. When I deselect it because I dont want the meta description, it shows only a few words.

I guess cancelling meta description in show results page completely will solve the issue. I dont know how.
Re: "show an extract from the page text" shows 2-3 words only
December 27, 2011 08:05AM
How the page's content is structured has a lot to do with it. If the searched for words are not together or are not part of a paragraph with enough characters (IE: 200) then the search results will only show what it can. It can't combine snippets of content to fill the 200 character space.
Tec
Re: "show an extract from the page text" shows 2-3 words only
December 27, 2011 09:11AM
Assuming that the full text of the indexed page is longer than the count of characters as defined in Admin backend.

The text extract shown in result listing always contains the count of characters as defined in Admin backend ($desc_length). Independent whether it shows all search words. In any case Sphider will show the first word of the total query, found in the full text. The text extract of full text is starting 30 characters before the found keyword.
$begin_pos = max(0, $places[$begin] - 30);
$fulltxt = substr($fulltxt, $begin_pos, $desc_length);
If the second and further search words (e.g. for AND search) are to be found outside of the text extract, they will not be shown by original Sphider.

Tec



Edited 1 time(s). Last edit at 12/27/2011 09:12AM by Tec.
Sorry, only registered users may post in this forum.

Click here to login