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

tindal davide.natalini at gmail.com
Tue May 6 13:35:32 BST 2008


ok, problems solved :)

>> modtime=2008-05-06
> 
> modtime should be a Unix timestamp (number of seconds since midnight,
> 1st January 1970).

I didn't notice the specification of the "date" action, but it claims it 
should work with "yyyymmdd" format, too, but it doesn't (at least for me)

in unix format it works, thanks

> 
>> omega reads the size wrong, as it says, in this example, "436 bytes": why?
> 
> That's not obvious to me. If you pull out the document data for that
> document, what does it look like?
> 

it turns out that I didn't purge the database, and some past experiment 
gave me the unexpected result, now it works as expected


>> 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?
> 
> Are you setting it elsewhere? eg, do you have a hidden field which
> contains the previous value?
> 

yes!
thanks for the tip, I didn't notice that line in the query template



finally, these are the command and the scriptindex script I'm using now, 
in case someone will find them useful:

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


filelist2omega.script:

url : index hash field=id field=url unique=Q boolean=Q
name : weight=3 index field=name
path : index field=path
format : index field=format
size : index field=size
modtime : index field=modtime date=unix



thanks to all

Xapian rocks :)

tindal



More information about the Xapian-discuss mailing list