Skip to main content.
home | support | download

Back to List Archive

Re: [swish-e] searching in a particular range regarding a metadata field

From: Peter Karman <peter(at)not-real.peknet.com>
Date: Wed May 13 2009 - 01:36:14 GMT
Zhou Xiang wrote on 5/12/09 4:48 PM:
> Hi,
> 
> I have indexed a metadata field "date", which is numerical value.
> I want to search files in a particular range according to "date" field, so I
> execute like this:
> 
>   $limitstring = "'Date', '1900', '2009'";
>   $search->set_search_limit($limitstring); //limit by year
> 
> But it does not work. However, it can sort on "date" field correctly.

the docs say that set_search_limit() takes an array.

  $search−>set_search_limit( $property, $low, $high );

you passed a scalar.

try instead:

  my @limit = qw( date 1900 2009 );
  $search−>set_search_limit( @limit );


-- 
Peter Karman  .  http://peknet.com/  .  peter(at)not-real.peknet.com
_______________________________________________
Users mailing list
Users@lists.swish-e.org
http://lists.swish-e.org/listinfo/users
Received on Tue May 12 21:36:12 2009