[ic] simple search question :)

John Beima interchange-users@lists.akopia.com
Tue Jun 5 02:03:00 2001


Quoting Andreas Lindenblatt <azrael@solution.de>:

> John Beima wrote:
> > 
> > Which results are missing? Can you give data and search examples...
> 
> Exactly like before:
> 
> > > The code works always for eg.:
> > > 3er-Reihe,346L/C/R, (E46)
> > > 6er-Reihe,Typ 6CS/1

Okay given this works...

> > > never works (returns nothing) for:
> > > 3er-Reihe, Typ 3B,3C,3/CG (E36) 
> > > 5er-Reihe , Typ 5/D (E39)

Have you verified that these values are actually in the scratch variable?


> > > and always gives more results than expected for eg.:
> > > Audi 80
> > > (results contain also 'Audi 80/90 Typ 81/85')

You are correct. It will find ALL cases of Audi 80, even if it is part pf a
larger sentence... This is why I take it you were trying to use the su
parameter... My understanding of the su parameter is it is for substring matches
in words, not sentences.. So se=Au would find Audi or Aunt... Not the first 2
words of a sentence...

> The only difference was due to the ml=250, which was more than the
> default I set somewhere.

If it is not defined it will default to 10...

> > Your search has a flaw when the scracth dummy variable has spaces in
> it.
> What do you mean by 'flaw'? 
> I'm searching for a complete string (eg. "3er-Reihe,346L/C/R, (E46)") in
> a database field which definitely contains this string. I want only
> match if everything I search for is exactly the way I query it. So I
> have to have the spaces in it, don't I? Shall I escape them?

Escaping them would possibly help... The way you are formatting the loop command
is just not the best way to do it.

> > You are also telling it to seach the txt file and not the MysQL file.
> The
> Hmmm... I understand that you have a lot more experience with IC than I
> have - but if this would be the case my search could never give me any
> result as I never touched the txt-file and IMHO there's no way it could
> even contain the fields I'm looking for.

Well I am not going to dibate this point with you. Your parameter is WRONG. Your
search only works sometimes. Part of that is the way you have written you loop
command. It is not the best way to do it.

> > "op=eq" isn't needed do to the fact that there is only one search
> criteria...
> > The su parameter isn't normally needed...
> ok.

You can try adding the op=eq back to my original code... It may or may not help.
But run my code the way I typed it and not the way you format it.

> > One question..Does dummy have one patter you are looking for? Or does
> dummy
> > contain several words that you want tp search for seperatelt???
> Dummy contains one pattern. It's exactly the pattern I want to match in
> the field subcategory_typ.

DO you run the results through a [more] tag or not? If not and it is just one
big list, do you search and then durring the display list just don't display the
items that arn't a perfect match with a simple if statement.


John Beima
jbeima@palb.com, support@alocalagent.com, and support@alocalchurch.com

P.A.L.B. Systems - Phone: (780)451-1086 - Fax: (780)447-4760
11639-122 Street, Edmonton, Alberta, Canada, T5M 0B6

Affordable Web Pages - Phone: (888)932-9990 - Fax: (256)351-7297
2713B Spring Place SW, Decatur, Alabama, United States, 35603