We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

LiveSearch

Development and Programming

Paul Burdick's avatar
Paul Burdick
480 posts
20 years ago
Paul Burdick's avatar Paul Burdick

According to my browser it has a ./welcome.php there. I want to remove the period and make it absolute. I think the browser’s hate us.

       
evan flows's avatar
evan flows
33 posts
20 years ago
evan flows's avatar evan flows

…as my son would say “my bad” - I missed the period in the code.

No errors now, but also no results for “search” which generates 5 results via the simple search.

       
Paul Burdick's avatar
Paul Burdick
480 posts
20 years ago
Paul Burdick's avatar Paul Burdick

I think there is something wrong with the template that does the actual search. No matter what I put in the URL, I get No Results every time. Ex:

http://www.yoursite.com/welcome.php/KB/livesearch?s=search

       
evan flows's avatar
evan flows
33 posts
20 years ago
evan flows's avatar evan flows

Here is the contents of the template “KB/livesearch” It was copied from this thread.

<?php

global $IN, $DB, $LOC;

if (!$IN->QSTR) { exit; }

$search_phrase =& urldecode($IN->QSTR);

$query = $DB->query(“SELECT distinct(a.entry_id), a.url_title, a.title, b.blog_url FROM exp_weblog_titles a, exp_weblogs b WHERE a.weblog_id = b.weblog_id AND a.status != ‘closed’ AND (a.expiration_date > ‘”.$LOC->now.”’ OR a.expiration_date = ‘0’) AND a.title LIKE ‘%{$search_phrase}%’ ORDER BY rand() LIMIT 0,10”);

if ($query->num_rows == 0) { exit(‘No Results’); }

foreach($query->result as $row) { echo ‘<a href=”’.$row[‘blog_url’].$row[‘url_title’].’”>’.$row[‘title’].’</a><br />’; }

?>

       
Paul Burdick's avatar
Paul Burdick
480 posts
20 years ago
Paul Burdick's avatar Paul Burdick

Well, call me a fool, I should have seen the problem sooner. Try this:

liveSearchReq.open(“GET”, “/welcome.php/KB/livesearch/” + document.forms.searchform.s.value + “/”);

       
evan flows's avatar
evan flows
33 posts
20 years ago
evan flows's avatar evan flows

It works…wise one. Thanks.

Where do I change the search results page that is used? It is dumping out to a different page than the simple search results.

       
Paul Burdick's avatar
Paul Burdick
480 posts
20 years ago
Paul Burdick's avatar Paul Burdick

Upon submission? The problem is that the EE search is too complicated for such a simple form. The original incarnation of it had the form go to the first result, but that would require making everything a bit more complicated.

       
evan flows's avatar
evan flows
33 posts
20 years ago
evan flows's avatar evan flows

I found the errant setting for search results and corrected it in the search preferences.

How does Livesearch choose which weblog to use for the templates? It currently is choosing the original “weblog1” settings.

Also, can the searching be restricted to a single weblog?

Livesearch appears to only be searching the title - is this true?

Can the simple_search be modified to accept 2 characters (3 seems to be the default)?

Do you think that the “keyboard navigation” will be added to the EE version.

Thanks Paul.

       
Paul Burdick's avatar
Paul Burdick
480 posts
20 years ago
Paul Burdick's avatar Paul Burdick

It searches all weblogs via title currently, and then creates the links based on that entry’s weblog’s Weblog URL.

Yes, only title.

Yes, but it requires a javascript change, look for this and change the 4 to a 3:

if (liveSearchReq && liveSearchReq.readyState < 4)

Sure, why not. This add-on is not a high priority so do not expect to see it for a while yet.

       
Adrienne L. Travis's avatar
Adrienne L. Travis
213 posts
20 years ago
Adrienne L. Travis's avatar Adrienne L. Travis

Any more thoughts on making this an actual plugin?

       
Paul Burdick's avatar
Paul Burdick
480 posts
20 years ago
Paul Burdick's avatar Paul Burdick

Still a really cool plugin idea, but still no time soon. I have a nice list of things I must do before I can focus on this, but if anyone wants to try their hand at it I could probably give pointers in the Developer forums.

       
melissajc's avatar
melissajc
86 posts
20 years ago
melissajc's avatar melissajc

this is awesome. I was pulling my hair out trying to get something to work with this script, then I found this thread and viola! Yay! thanks 😊

       
John Hoke's avatar
John Hoke
5 posts
20 years ago
John Hoke's avatar John Hoke

I just deployed this on my test pages in like 10 minutes… Paul/Chris/LJ thanks for the tips/ideas and code 😊

       
EE lover's avatar
EE lover
50 posts
20 years ago
EE lover's avatar EE lover

Is there anyone using this tread’s metod anymore?

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
20 years ago
Lisa Wess's avatar Lisa Wess

I was until a few days ago, may put it back on my search page. Just didn’t fit on my main page anymore.

       
First 3 4 5 6 7

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.