Skip to main content.
home | support | download

Back to List Archive

Re: [swish-e] exact search problem

From: Thomas den Braber <thomas(at)not-real.delos.nl>
Date: Sun May 17 2009 - 14:09:17 GMT
Peter,

I used it from perl with the Swish api.
I use Swish-e 2.4.7.

This is the command:

 ...
 my $search = $swish->New_Search_Object;
 $search->SetSort( $order );
 my $query = q|"M. Jones"|;
 my $results = $search->Execute( $query);

That means, yes I put quotes around it.

I also tried it from the command line (didn't think about that option) and
it worked !

Does it look like it must be something with the Swish api or a Perl thing ?

--

Thomas

-----Original Message-----
From: Peter Karman <peter@peknet.com>
To: Swish-e Users Discussion List <users@lists.swish-e.org>
Date: Fri, 15 May 2009 22:23:35 -0500
Subject: Re: [swish-e] exact search problem

> Thomas den Braber wrote on 5/14/09 2:21 AM:
> > HI,
> > 
> > I found a strange behavior when doing an exact search in an
> metafield.
> > 
> > I have done:
> > 
> >  PropertyNamesIgnoreCase persons
> >  MetaNames persons
> > 
> > I add a value of:  M. Jones  in persons and do an exact search for
> > 
> >  persons="M. Jones"  this will find no hits
> > 
> > If I do persons="M Jones" it will also find nothing
> > Only persons="Jones" will work
> > 
> > If I add the value M Jones  ( without the .) in the persons field,
> > then a search for: persons="M Jones" will give hits (even if I search
> for
> > persons="M. Jones")
> > 
> > I use:
> > 
> > WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-_&
> > 
> > IgnoreFirstChar .-_$&
> > IgnoreLastChar  .-_&
> > 
> > BeginCharacters abcdefghijklmnopqrstuvwxyz0123456789
> > 
> > I would think that the . is just stripped if you add "M. Jones" so
> you
> > could search for persons="M Jones" would give results
> > 
> > It looks like if an . is in the value then an exact search will not
> work
> > anymore
> > 
> > Any clue ?
> > 
> 
> are you running the query from the command line? did you single quote
> the entire
> query to make sure the shell isn't interpreting the double quotes?
> notice the
> example below:
> 
> [karpet@pekmac:~/tmp]$ swish-e -w jones
> # SWISH format: 2.4.7
> # Search words: jones
> # Removed stopwords:
> err: no results
> .
> [karpet@pekmac:~/tmp]$ swish-e -w persons=jones
> # SWISH format: 2.4.7
> # Search words: persons=jones
> # Removed stopwords:
> # Number of hits: 1
> # Search time: 0.000 seconds
> # Run time: 0.004 seconds
> 1000 jones.xml "jones.xml" 42
> .
> [karpet@pekmac:~/tmp]$ swish-e -w persons="M Jones"
> # SWISH format: 2.4.7
> # Search words: persons=M Jones
> # Removed stopwords:
> err: no results
> .
> [karpet@pekmac:~/tmp]$ swish-e -w 'persons="M Jones"'
> # SWISH format: 2.4.7
> # Search words: persons="M Jones"
> # Removed stopwords:
> # Number of hits: 1
> # Search time: 0.001 seconds
> # Run time: 0.006 seconds
> 1000 jones.xml "jones.xml" 42
> .
> [karpet@pekmac:~/tmp]$ swish-e -w 'persons="M. Jones"'
> # SWISH format: 2.4.7
> # Search words: persons="M. Jones"
> # Removed stopwords:
> # Number of hits: 1
> # Search time: 0.000 seconds
> # Run time: 0.009 seconds
> 1000 jones.xml "jones.xml" 42
> .
> [karpet@pekmac:~/tmp]$ cat jones.conf
> PropertyNamesIgnoreCase persons
> MetaNames persons
> DefaultContents XML*
> WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-_&
> IgnoreFirstChar .-_$&
> IgnoreLastChar  .-_&
> BeginCharacters abcdefghijklmnopqrstuvwxyz0123456789
> [karpet@pekmac:~/tmp]$ cat jones.xml
> <doc>
>  <persons>M. Jones</persons>
> </doc>
> [karpet@pekmac:~/tmp]$
> -- 
> 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


_______________________________________________
Users mailing list
Users@lists.swish-e.org
http://lists.swish-e.org/listinfo/users
Received on Sun May 17 10:09:24 2009