FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADS not supports hb_WildMatch( '"+cWild+"', DbRecordInfo
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
ADS not supports hb_WildMatch( '"+cWild+"', DbRecordInfo
Posted: Wed Mar 14, 2012 01:41 PM

Hello,

I use in DBFCDX this way to filter for all fields:

cWild := ""+ "value to search A BUSCAR" +""
cFiltro := "hb_WildMatch( '"+cWild+"', DbRecordInfo( 9 ) ) .OR.
hb_WildMatch( '"+UPPER(cWild)+"', DbRecordInfo( 9 ) ) .or. hb_WildMatch(
'"+lower(cWild)+"', DbRecordInfo( 9 ) ) "

SET FILTER TO &cFiltro

It runs very well.

But ADS does not support it.

I tried with no luck:

cName := "LUCAS"
cExpr1 := 'contains( , "'+UPPER( alltrim(cName) )+'*" ) '

AdsSetAOF( cExpr1 )

Any clue please?.

Thank you very much.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: ADS hb_WildMatch( '"+cWild+"', DbRecordInfo
Posted: Thu Mar 15, 2012 04:36 PM

UP-.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: ADS not supports hb_WildMatch( '"+cWild+"', DbRecordInfo
Posted: Fri Mar 16, 2012 07:50 PM
  1. You could try using the like operator with ADS.
  2. Contains works perfectly if you create an FTS index on the fields where the search is to happen. No need for wild cards. Contains already searches the whole field (great for memo fields).

(cAlias)->( AdsSetAof( "contains( field, 'text' )" ) )

or

cText := "Texto"

(cAlias)->( AdsSetAof( "contains ( field,' " + ALLTRIM( cText ) + " ' ) " ) )

Notice the use of the single quotation marks and there is no blank spaces between the single and double quotation marks.

This will work with or without an FTS index, but it is simply much faster with it.

Reinaldo.

Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: ADS not supports hb_WildMatch( '"+cWild+"', DbRecordInfo
Posted: Fri Mar 16, 2012 08:35 PM

Reinaldo,

Thank you very much for helping me.

Yes, I at news.advantage they told be the function Contains.

In a single field works very good.

But not for all fields.

They told me to use *
AdsSetAof( "contains( *, 'text' )" )

But does not filter anything.

How do you create a FTS index for all fields of a DBF?.

Thank you very much.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: ADS not supports hb_WildMatch( '"+cWild+"', DbRecordInfo
Posted: Tue Mar 20, 2012 07:48 AM

up.-

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: ADS not supports hb_WildMatch( '"+cWild+"', DbRecordInfo
Posted: Tue Mar 20, 2012 09:37 AM
Lucas,

depending on the ADS version, the search in all fields by using the asterisk * is combined with the AND operator, so the chance to find suitable data sets might be very low!

For example, I'm using constructs like this
Code (fw): Select all Collapse
contains( dbtrn->Name1, "cPattern" ) OR contains( dbtrn->Name2, "cPattern" ) OR contains( dbtrn->Name3, "cPattern" ) OR contains( dbtrn->Pst_str, "cPattern" ) OR contains( dbtrn->Ort, "cPattern" ) OR contains( dbtrn->Bmrkng, 聽"cPattern" ) OR contains( dbtrn->Telefon, "cPattern" ) OR contains( dbtrn->Telefax, "cPattern" )
for searching in our address table.

HTH
Windows 11 Pro 22H2 22621.1848

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Harbour 3.2.0dev (r2008190002)

FWH 23.10 x86

Continue the discussion