View Single Post
Old 04-15-2008, 10:25 AM   #1
daudi
Addict
daudi has learned how to read e-booksdaudi has learned how to read e-booksdaudi has learned how to read e-booksdaudi has learned how to read e-booksdaudi has learned how to read e-booksdaudi has learned how to read e-booksdaudi has learned how to read e-booksdaudi has learned how to read e-books
 
Posts: 281
Karma: 904
Join Date: Oct 2007
Location: Kent, UK
Device: iRex iLiad, Psion 5MX, nokia n800
Multi-directory search

This is a spin-off from something else I'm playing with. The built-in iliad search will only search the current directory, and if I'm not mistaken will only search the title field, not the description.

This little script will allow you to search multiple directories and will grep the manifest file. This means you can put key words in the description field and it will match on those.

There is another script (contentlister entry) for deleting the results. Don't use the built-in delete because this deletes the original files rather than the symlinks. I think thomas posted a better way to do symlinks and I'll try using that later.

You enter the search phrase by changing the FIRST LINE of the description field of the search entry. At the moment this is "wibble", because that is what I was searching for when testing this. Use the label function to change the description, then click on the search entry.

So, in summary, these are the steps:
  1. get shell access if you do not already have it
  2. unzip search.zip somewhere, e.g. your PC
  3. copy the whole thing to somewhere on your iliad (anywhere will do)
  4. navigate to the search folder using the contentlister
  5. use the config entry to select where to search
  6. change the description field to your search expression
  7. click on the "search" entry in the contentlister
  8. when the search is complete you will see a "results" folder
  9. view your results in the results folder
  10. delete the results using the "delete" entry in the contentlister
I started doing this because I think I will soon have a way of tagging and taking snippets from PDFs and plan to store the tags in a tags file in the appropriate PDF container directory and snippets in a snippets file. I want to be able to search for snippets or tags.

The main limitations at the moment are:
  1. no way to search within search results
  2. you have to navigate to the search folder, you can't just get there quickly from anywhere
  3. inelegant way of getting user input

You can set the place to start searches to any location you like. Just add entries to the file config/search.rc

I've tested this a little on my USB key with about 800Mb of files and it did not fall over. Feedback welcome.

Edit: just made a couple of updates to zip file.
Edit: the limit on the number of results is not working. I'll have to look into this.
Edit: new version---quoted search expression to allow spaces
Edit (2008-05-01): new version that I think fixes the spaces in filename problem and adds a path config tool. Also fixed hit limit.
Edit (2008-05-01): Added snippet search tool
Edit (2008-08-11): Fixed CF search problem
Attached Files
File Type: zip search.zip (15.8 KB, 405 views)

Last edited by daudi; 08-11-2008 at 10:42 AM. Reason: New version 2008-08-11. Fixed CF search problem
daudi is offline   Reply With Quote