[Xapian-discuss] locate and omega: how to index file names?

tindal davide.natalini at gmail.com
Tue May 6 11:31:13 BST 2008


ok, that's my (still partial) solution:

find /dir/* -type f -printf 
'url=%p\npath=%h\nname=%f\nsize=%s\nmodtime=%AY-%Am-%Ad\n\n' |awk '{if 
($1 ~ /^path=/) gsub(/\//, "\n="); if ($1 ~ /^name=/) 
sub(/\./,"\nformat="); print}'| scriptindex /database/dir/filelist 
filelist2omega.script


in which filelist2omega.script contains:

url : index field=id field=url
name : weight=3 indexnopos hash field=name
path : indexnopos field=path
format : index field=format
size : index field=size
modtime : index field=modtime


and that's the record format for scriptindex:

url=/full/url/of/the/file.txt
path=
=full
=url
=of
=the
name=file
format=txt
size=436110
modtime=2008-05-06


now 3 more questions:

the date format is not correct, as omega doesn't show it: which is the 
correct one?

omega reads the size wrong, as it says, in this example, "436 bytes": why?

for the search I'd like to be able to choose between the "default" 
database (made with omindex) and my "filelist" database, but I end up 
searching both databases

the relevant code in the template is:
<INPUT TYPE=radio NAME="DB" VALUE="default" 
$if{$eq{$dbname,default},CHECKED}>Search the contents<br>
<INPUT TYPE=radio NAME="DB" VALUE="filelist" 
$if{$eq{$dbname,filelist},CHECKED}>Search the names<br>

I find that after the first change of database $dbname contains 
"default/filelist" or "filelist/default": how can I reset it?

thanks
tindal



More information about the Xapian-discuss mailing list