04-15-2008, 10:25 AM | #1 |
Addict
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:
The main limitations at the moment are:
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 Last edited by daudi; 08-11-2008 at 10:42 AM. Reason: New version 2008-08-11. Fixed CF search problem |
04-16-2008, 08:13 AM | #2 |
Pac-Man caught my iLiad.
Posts: 807
Karma: 3595
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: Boox Max Lumi, iRex iLiad (RIP)
|
It seems like spaces are not allowed in directory names.
Code:
Search string: Krause grep: /mnt/cf/pdf/Foundations: No such file or directory grep: of: No such file or directory grep: GTK+: No such file or directory grep: Development/manifest.xml: No such file or directory [...] ./run.sh: 87: [[: not found [EDIT] I had got a space bug in my jukebox mpd scripts, too. |
Advert | |
|
04-16-2008, 08:45 AM | #3 |
Addict
Posts: 281
Karma: 904
Join Date: Oct 2007
Location: Kent, UK
Device: iRex iLiad, Psion 5MX, nokia n800
|
Thanks! I've now quoted the grep so hopefully fixed the space bug.
|
04-16-2008, 09:08 AM | #4 | |
Pac-Man caught my iLiad.
Posts: 807
Karma: 3595
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: Boox Max Lumi, iRex iLiad (RIP)
|
Quote:
[very OT] Battery of my iLiad is low & I don't have a power adapter next to mine. Last edited by yokos; 04-16-2008 at 09:09 AM. Reason: doesnt != doesn't |
|
04-28-2008, 05:53 AM | #5 | |
Addict
Posts: 281
Karma: 904
Join Date: Oct 2007
Location: Kent, UK
Device: iRex iLiad, Psion 5MX, nokia n800
|
Quote:
|
|
Advert | |
|
04-29-2008, 09:03 AM | #6 | ||
Pac-Man caught my iLiad.
Posts: 807
Karma: 3595
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: Boox Max Lumi, iRex iLiad (RIP)
|
Quote:
It should be no deal to update busybox. Termial apps are dream targets to port compared to GUI apps with all the odds. I think Adam hasn't enabled all features of busybox during configure to make the binary small. EDIT: Quote:
Last edited by yokos; 04-29-2008 at 09:07 AM. |
||
04-29-2008, 09:21 AM | #7 |
Addict
Posts: 281
Karma: 904
Join Date: Oct 2007
Location: Kent, UK
Device: iRex iLiad, Psion 5MX, nokia n800
|
Ahaaa. Very helpful, thanks. I'm not going to be able to look at this again for a few days, but this will save me time mucking around trying to figure out things that might not need figuring out. Thanks.
|
05-01-2008, 09:15 AM | #8 |
Addict
Posts: 281
Karma: 904
Join Date: Oct 2007
Location: Kent, UK
Device: iRex iLiad, Psion 5MX, nokia n800
|
It turned out to be rather easy to make this work with the standard busybox so I have decided to do that rather than require people to upgrade their version of busybox. I have tested it and think it is working now with directories with spaces in the path and would be grateful it you could try it again Yokos.
I have also changed the way that search paths are configured. Instead of having to hard code the path in the script, I have now added a config contentlister entry that reads a file called search.rc. This file consists of one line per directory, a semi-colon and a description. The default contents on this file are: Code:
/mnt/usb;USB /mnt/cf;Compact flash /mnt/free;All internal memories I've also fixed the number of hits limit code. This is currently set to 40 results. You can change this near the top of the script. I'm updating the post at the top of this thread with this version. Last edited by daudi; 05-01-2008 at 09:18 AM. Reason: Added note about hit limit code |
05-02-2008, 11:37 AM | #9 |
Connoisseur
Posts: 80
Karma: 111
Join Date: Apr 2008
Device: iliad V2; ipad 2-64GB,3G
|
Problem installing Search
Dear Daudi,
Good day! Thank you for working so diligently on such great and useful tool. I have tried to install this tool several times, but unsuccessfully. i am not getting the message " installation successful". I am able to switch the locations for research between internal memory, USB and CF, but the launching of research is unsuccessful, the iliad does not react when I click on search folder... Any ideas or suggestions on what I could do to get it working? Thanks a million in advance! D. |
05-02-2008, 11:50 AM | #10 | ||
Addict
Posts: 281
Karma: 904
Join Date: Oct 2007
Location: Kent, UK
Device: iRex iLiad, Psion 5MX, nokia n800
|
Quote:
I suspect it probably is running but using the default search pattern. I think I probably need to re-write the first post or write another one to make things clearer. A key thing from my first post is: Quote:
WARNING! At the moment the general search searches the entire manifest file. This means that if you are searching for "The Great Escape", for example, do not enter "esc" as the search phrase. "esc" will match "escape" okay, but it will also match "Description" which exists in (almost?) every manifest file. BTW, I should also explain that the snippet-search relates to this thing. If you have entered your search phrase correctly and it is still not working we'll have to delve a little deeper. Let me know how you get on. |
||
08-08-2008, 01:25 AM | #11 | |
Member
Posts: 13
Karma: 10
Join Date: May 2008
Location: Pacific Northwest, US
Device: iRex Iliad
|
Quote:
The search folder is loaded in Newspapers/Programs/Search. Newspapers is on the CF card (according to iLiad Settings/Archive Locations page) The document I am searching for has a two line description. The only thing that may be odd is that the iLiad did not generate the manifest.xml. I am using another program that I wrote to generate it. It is located in documents/publications/[folder name]/ (also on the CF card) I am editing the first description line of the search program using the tagging tool. In today's case, the search term is banding. The config program is switching modes just fine, but the search tool runs and no change is shown in contentlister (the screen does refresh). Is there some error log I can look at? Thanks, Last edited by engunneer; 08-08-2008 at 01:28 AM. Reason: forgot to mention path of expected result |
|
08-08-2008, 08:07 AM | #12 |
Addict
Posts: 281
Karma: 904
Join Date: Oct 2007
Location: Kent, UK
Device: iRex iLiad, Psion 5MX, nokia n800
|
Hi engunneer,
There's no logging at the moment, but I'll look into it. For now, some questions that might help to track down the source of the problem:
|
08-10-2008, 02:02 AM | #13 |
Member
Posts: 13
Karma: 10
Join Date: May 2008
Location: Pacific Northwest, US
Device: iRex Iliad
|
Thanks for getting back to me.
1. The LED blinks and the White Loading bricks at the bottom do show for about 2 seconds. My CF card is 2GB and about half full. None of the bricks turn black. 2. No results at all (I do have the entry to delete results) 3. I am using the default one you have posted above. I have tried all of the settings, but Compact flash is the one that should work in this case. 4. the files are created, but both are empty. If I can get this working, then I will try to get your snippet tool working (on windows), which looks very impressive. Then I will publish the project for the iLiad that I have been working on. Update: Setting to "All internal memories" does at least run long enough to get one black box to fill. At this point, I am suspecting that the manifet.xml of my target files are somehow wrong? I can try to upload an example doc tomorrow. Last edited by engunneer; 08-10-2008 at 02:16 AM. |
08-10-2008, 09:41 AM | #14 | |
Addict
Posts: 281
Karma: 904
Join Date: Oct 2007
Location: Kent, UK
Device: iRex iLiad, Psion 5MX, nokia n800
|
Quote:
Code:
find "$STARTDIR" -type f -name 'manifest.xml' > match.tmp |
|
08-10-2008, 07:49 PM | #15 |
Member
Posts: 13
Karma: 10
Join Date: May 2008
Location: Pacific Northwest, US
Device: iRex Iliad
|
I can verify the extension. Extensions in uppercase bug the heck out of me, and I also wrote the program that is generating them.
I also have some documents that were nout generated by my program, and I have manually tagged them on the iLiad, and the search program still doesn't find them. I have not tried to experiment with ssh access, but theoretically could if you think it will help me diagnose this. Thanks for taking the time to try and help. Is there something I can hardcode instead of $STARTDIR, so that it is known good? should I try running it via mrxvt? Thanks. Last edited by engunneer; 08-10-2008 at 07:53 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SD Directory Limit | single650 | Sony Reader | 3 | 03-09-2010 04:45 AM |
I Can't add a directory | takelu | Calibre | 2 | 02-05-2010 07:21 PM |
directory structure | Dopedangel | Calibre | 7 | 08-20-2009 06:17 AM |
iLiad Directory Tree | The GreatGonzo | iRex Developer's Corner | 2 | 09-18-2007 11:52 AM |
Google Book Search to search full-text books online | Bob Russell | Deals and Resources (No Self-Promotion or Affiliate Links) | 1 | 08-19-2006 12:13 PM |