![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
||||
|
||||
Description / Excerpts off content in Search Engine Results PagesWhen you search Google for the phrase: java forums and view the results listed on the SERPs, look at the description (or excerpts) off the web page just below each link.
Notice how it's extracted off the web page and just at the right points where the key words inside the search phrase appear (in bold / highlighted)? I am just wondering if someone here can give me some ideas on how to go about doing this. Of course I don't expect any code examples, just the logic (or pseudocode) will do. I realise that this question is not particularly related to PHP but since the functionality will be added to a PHP script, I thought I'd start the thread here. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#2
|
|||
|
|||
|
Hi JdS,
Sorry I havent visited for a while but I have been very busy. Back to your problem.... If I understand you just want to highlight/bold the search keyword? If so I have done a database search (not finished yet but nearly) and to highlight the keyword or term I have used Quote:
Quote:
This converts the search term to Upper case and Bold. It also (using the class) highlights the background. Hope this is what you want. If not |
|
#3
|
||||
|
||||
|
Thank you for the effort misunderstood, but I may not have explained my issue very well. I am not referring to the highlighting (I can do that with my eyes closed
It looks simple but I REALLY can't think of a smart way to get this done. If anyone has a problem trying to understand what exactly it is that I am after, take this whole page as an example. If I searched for the phrase "search", and this page is returned as link, the description for the contents off this page could look a bit like this: Quote:
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#4
|
|||
|
|||
|
I am confused now
Are the pages you want to search html or database? |
|
#5
|
||||
|
||||
|
Yes, I am sure you are - cause I am reading my last reply and I am also confused. Perhaps that's part of the problem...
Anyway, regardless of whether I am trying to get this off HTML or a database, I need some kind of a script to fetch the right bits off sentences on a web page containing the search phrase - hey! I think I explained it a bit better this time. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#6
|
|||
|
|||
|
Ahhh I see what you want. It did help that I have been reading about your search engine script
I was a liitle confused because I thought you was searching your own site database and displaying the results. Which would be simple to a man of your calibre. |
|
#7
|
||||
|
||||
|
It seems simple but it's not, I assure you. I have only been thinking about it for days now...
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#8
|
|||
|
|||
|
OK what about 'explode' search term, find each word seperately in text, bold/highlight each word, 'implode' and display? Or am I completely off track?
|
|
#9
|
||||
|
||||
|
Splitting the search term when there are multiple words in it, is done and working well.
Finding the sentences containing one or more of the keywords is the hard part. Harder still is knowing where to pick the start of a/the sentence and when to chop it off. Then it must be done for multiple pages (considering a single SERP may contain not less than 10 results / links). I had something that worked ( using preg_match_all() ) BUT it was a monster of a script... took too much time and I didn't feel comfortable with it - came here to look for some inspiration or fresh ideas. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#10
|
|||
|
|||
|
Why not display the sentence or text where the first instant of all the words are present within a specified number of characters? If they are spread miles apart then the contect of the search would probably be irrelevant.
|
Recent GIDBlog
First week of IA training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Building a search engine and handling HTML entities. | JdS | Web Design Forum | 2 | 27-Mar-2004 16:21 |
| Please list your site on my search engine | jake2003 | Search Engine Optimization Forum | 5 | 18-Dec-2003 13:46 |
| Wayback machine releases the recall search engine | jrobbio | Web Design Forum | 2 | 12-Sep-2003 14:40 |
| How a search engine really works (In english) | jrobbio | Open Discussion Forum | 0 | 06-Jul-2003 17:13 |
| Search Engine Positioning 101 and 201 "How To" Tips... | 000 | Search Engine Optimization Forum | 0 | 29-May-2003 10:34 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The