Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2011-02-23 19:09:23

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: rah_file_search

Gocom wrote:

As it’s supposed to do.

I thought so. I was contrasting my experience with Ax’s in hopes it might help him figure a way to use the plugin_in w/out asking his readers to alter the url.

Yes. Designed as such.

I suspected that was the case.

This site I’m working on is the first one with a number of files to use your plugin (my last site with lots of files to download was long before you released this). So it’s the first time I’m really figuring it out.

This site is for a teacher. She has downloads for the kids. The limitation of searching only file names may mean it’s not the right fit for this use case. Perhpas a custom google search instead. But just to check – is there a place in the code I could easily alter it to check the file title instead of the file name>

Thanks

Mike

Offline

#26 2011-02-23 19:26:44

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_file_search

An another update released. Version 0.5 changes:

  • Added title to searchable fields in addition to filename and description.

More info and downloads

Offline

#27 2011-02-23 19:36:59

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: rah_file_search

Works perfect!

Thanks Jukka!

Offline

#28 2011-02-23 23:14:18

ax
Plugin Author
From: Germany
Registered: 2009-08-19
Posts: 165

Re: rah_file_search

maverick wrote:

Works perfect!

Thanks Jukka!

Yes, it works perfectly for me too (in a section). Thanks, Jukka!

The only issue that I still have is that it cannot be used to upgrade rah_link_search to 0.5 when you do %s/file/link/g in the source file, because I would really need both plugins. Obviously, it is more complicated than that?

Offline

#29 2011-03-23 23:53:45

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 595
Website

Re: rah_file_search

Jukka, thanks for this plugin. I’m getting mixed results though, and thought I’d ask for help:

For a file named “Red Sports Sedan 2010,” The search term “red” will return this file. But the search terms “red sports” or “red sedan” won’t return anything.

Relevant part of default page template:

<h2>File Results</h2>
<txp:rah_file_search limit="12" form="file_search_results" />

Form “file_search_results”:

<h3 class="entry-title"><a href="<txp:file_download_link />" title="Download <txp:file_download_name /> now"><txp:file_download_name title="1" /></a> </h3>
<p class="entry-summary">Filename: <txp:file_download_name />  [<txp:file_download_size />]<br />
Category: "<txp:file_download_category title="1" />"<br />
<txp:file_download_description />
</p>

Form “search”:

<div class="moduletable">
<txp:search_input match="any" form="search_form" />
</div>

Form “search_form”:

<form action="<txp:site_url />" method="post">
	<div class="search">
		<input name="q" id="mod_search_searchword" maxlength="40" alt="Search" class="inputbox" type="text" size="20" value="Search..."  onblur="if(this.value=='') this.value='Search...';" onfocus="if(this.value=='Search...') this.value='';" />
	</div>
</form>

Offline

#30 2011-03-24 02:18:42

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_file_search

maruchan wrote:

For a file named “Red Sports Sedan 2010,” The search term “red” will return this file. But the search terms “red sports” or “red sedan” won’t return anything.

Nothing wrong with the form or anything. It just is that the plugin doesn’t match individual words — currently. Might change in the future ;)

Offline

#31 2011-03-24 03:04:19

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_file_search

Released version 0.6:

  • Now searches words individually.
  • Searches are case-insensitive.

More info and downloads

Hope that helps Marc :)

Offline

#32 2011-03-24 03:17:13

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 595
Website

Re: rah_file_search

Uh, wow. Yeah, that should help! Thank you.

Question: I installed the new one after deleting the old one, but I’m wondering if I need to delete an old index or some tables? Because I’m seeing the same problem still.

Offline

#33 2011-03-24 03:27:16

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_file_search

maruchan wrote:

Question: I installed the new one after deleting the old one, but I’m wondering if I need to delete an old index or some tables? Because I’m seeing the same problem still.

Nope. What problems? For me it works just fine. I have total of four files;

  • One has name Red Sports Sedan 2010.png.
  • One has title Red Sports Sedan 2010, but name is 10.png.
  • Others are blank with numerical names 5.png and 6.png.

When I search:

  • “red” I get two hits
  • “Red Sedan” I get two hits.
  • .png four hits.
  • spORt sEdan two hits.

Last edited by Gocom (2011-03-24 03:55:15)

Offline

#34 2011-03-24 05:17:24

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 595
Website

Re: rah_file_search

When I search:

“red” I get two hits
“Red Sedan” I get two hits.
.png four hits.
spORt sEdan two hits.

Argh, that’s exactly what I want, too! I’ll get some sleep and try again tomorrow. Thanks again.

Offline

#35 2011-03-24 09:37:34

ax
Plugin Author
From: Germany
Registered: 2009-08-19
Posts: 165

Re: rah_file_search

Unfortunately, it returns results for either word, in this example you get results for all files containing “red” and also all files containing “sedan”. But wouldn’t you expect that two words are implicitly linked with an “and”, like Google does it?

Offline

#36 2011-03-24 12:44:33

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_file_search

ax wrote:

Unfortunately, it returns results for either word, in this example you get results for all files containing “red” and also all files containing “sedan”. But wouldn’t you expect that two words are implicitly linked with an “and”, like Google does it?

Sure should. Thanks :) v0.7 should help:

  • Now filters by all words, not any.

More info and downloads

Offline

Board footer

Powered by FluxBB