Using search without entering any keywords
Posted: 09 May 2008 07:46 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  605
Joined  05-16-2004

I’m trying to get search working on my site in such a way that a user can search without entering a keyword, because my user might want to look something up by date or category without knowing the title.  Normally, if you search without a keyword, you either get a message that says:

“Search terms must be at least 3 characters in length.”
or
“You did not submit a search term.”

I tried a workaround where I submitted a search with just a “*” character, as mentioned in this thread but that didn’t work—apparently, in 1.6.3, the “*” character is filtered out of searches.

Has anyone been able to get search to work without submitting a keyword?

TTFN
Travis

 Signature 

ExpressionEngine Roadshow - Vancouver BC - Sept. 26, 2008

Hop Studios Internet Consulting
http://www.hopstudios.com/

Profile
 
 
Posted: 11 May 2008 09:02 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  21199
Joined  05-20-2002

It’s not officially supported, so I’m going to shift over to ‘How to’- though it is a good feature request.

I’ve done it by hacking, which is not really what I’d recommend.  But it has consistently worked.  Though that thread’s pretty recent.  I’d have expected the method to work now if it worked then.

 Signature 

AKA rob1

Help Request Tips * Pro Network

Profile
 
 
Posted: 11 May 2008 10:46 AM   [ Ignore ]   [ # 2 ]  
Grad Student
Avatar
Rank
Total Posts:  42
Joined  01-27-2008
supersusie - 09 May 2008 07:46 PM

I’m trying to get search working on my site in such a way that a user can search without entering a keyword, because my user might want to look something up by date or category without knowing the title.  Normally, if you search without a keyword, you either get a message that says:

“Search terms must be at least 3 characters in length.”
or
“You did not submit a search term.”

I tried a workaround where I submitted a search with just a “*” character, as mentioned in this thread but that didn’t work—apparently, in 1.6.3, the “*” character is filtered out of searches.

Has anyone been able to get search to work without submitting a keyword?

TTFN
Travis

hey Travis, i’m very new to EE and still developing my first site, but i had some similar requirements on searching articles by date and other non-keywords, like genre, location, alphabetically by letter, by column name… and so on.

my new site is not “live” yet, so i won’t send you there. my site is a magazine that has published for 12 years. so i have “a lot” of archives to say the least.

i have not even worked on the “search engine” yet. but what i did do was create a sidebar navigation system that changes with each section of my site to sort the data in different ways using categories and templates.

i set up a ton of category groups and assigned them to the weblog, and as i have different sections, some of the groups are used on seperate weblogs. for instance, i set up a category group for just the years i’ve been published (1996-present), alphabetically (so i can manually assign a letter(s) to each weblog to sort by just the first letter, geographically (we’re Wisconsin, so each city, quadrant and even east/west side of Milwaukee type categories), by author and more.

once i set those up and had my categories very specific, i just created links for the sidebar nav to sort the info by URL with a click. so now, i can sort my articles by Genre, alphabetically, by the year, by the month, by location, by blog/column, by date asc/dsc.

like:
Bars in GREEN BAY
and the href is

example.com/index.php/calendar/C317

category 317 is the Green Bay category, so it sorts all the venues for calendars by the city. i have each city assigned a category.

or the link could be
example.com/index.php/calendar/category/greenbay

or
Search Articles by:
A B C D E....
the link on B for me would be:

example.com/index.php/articles/category/b

or example.com/index.php/articles/C322 where cat 322 is B

- figuring out this relationship of sorting using category, template structure and URL was my half “lightbulb” moment… lol, i’m still working on the other half.

to me, it’s like making coffee and the water is like the URL title/data from the weblog. you pull your water thru the filter (template) and the flavored coffe (category) mixes with the water to drip to a finished webpage.

so i guess my category system is just like a big cafe to sort my huge amounts of data, without using a search engine. Cappucino anyone?

 Signature 

Rökker
Publisher
http://www.maximumink.com

Profile
 
 
Posted: 11 May 2008 10:50 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  605
Joined  05-16-2004

Robin,

Can you show me a site where you can search without entering a keyword?

TTFN
Travis

 Signature 

ExpressionEngine Roadshow - Vancouver BC - Sept. 26, 2008

Hop Studios Internet Consulting
http://www.hopstudios.com/

Profile
 
 
Posted: 14 May 2008 02:45 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  605
Joined  05-16-2004

OK, I did find a way around this—if you search for -"no keywords” (or some other long and impossible phrase with a minus in front of it), you can successfully trick the EE search into doing a search that doesn’t require any keywords.

Next step—to make that variable be something passed internally to EE.

Step after that—hide that internal kludge from being displayed on the search result page…

TTFN
Travis

 Signature 

ExpressionEngine Roadshow - Vancouver BC - Sept. 26, 2008

Hop Studios Internet Consulting
http://www.hopstudios.com/

Profile
 
 
Posted: 05 June 2008 07:42 PM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  19
Joined  05-17-2007

I’m not sure if you’re still trying to get this working - but I needed to do something similar to this recently and the only way I got it working was by hacking the EE search module as described in this thread:

Advanced search that doesn’t require keywords?

It’s not recommended as Robin and the user in the thread says but seems like the only way until the functionality gets officially added?

Hope its of some use..

Matt

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 60714 Total Logged-in Users: 19
Total Topics: 73170 Total Anonymous Users: 14
Total Replies: 394637 Total Guests: 472
Total Posts: 467807    
Members ( View Memberlist )