Skip to main content.
home | support | download

Back to List Archive

Re: internal number question

From: Peter Karman <karman(at)not-real.cray.com>
Date: Mon Aug 30 2004 - 11:54:27 GMT
If you do:

swish-e -f yourindex -T index_metanames

you can see this:

swishfilenum : id= 4 type=42  META_INTERNAL META_PROP:NUMBER

in a search, the property 'swishfilenum' is available like any other 
property:

swish-e -f myindex -w foo -x '<swishfilenum>\n'

# SWISH format: 2.4.1
# Search words: foo
# Removed stopwords:
# Number of hits: 13
# Search time: 0.046 seconds
# Run time: 0.141 seconds
471
588
86
520
407
521
571
509
366
55
486
452
905
.

With SWISH::API I think you use the $result->Propery( "swishfilenum" ) 
method.

That's only one way to access the filenum (returning it as a property) 
and it only works after you've searched. If you wanted to know the 
filenum *before* searching, use this:

swish-e -f myindex -T index_files

and then parse that out to a db or file or whatever.

Hope that helps.


Jason Camp wrote on 8/30/04 12:34 AM:

> I'm writing an application around swish-e and I have a bunch of data stored in a
> database that I'd like to reference on search requests. I read that swish-e
> uses an internal numbered index for each search result, is there any way to
> access that number? I figure it would be the easiest way to associate the
> search results with the information in the database, I could base it off of the
> URL but the db operations would be much faster if it was numeric. Anyone have
> any thoughts? I looked through the properties list and I didn't see anything
> that looked to be the internal number. I'm using the SWISH::API perl module if
> that helps. Thanks!
> 
> Jason

-- 
Peter Karman  651-605-9009  karman@cray.com
Received on Mon Aug 30 04:54:43 2004