Indice FTS en Ads o Cdx normal???

Post Reply
D.Fernandez
Posts: 392
Joined: Wed Jul 31, 2013 1:14 pm
Location: Maldonado - Uruguay
Contact:

Indice FTS en Ads o Cdx normal???

Post by D.Fernandez »

Estimadso amigos:

Necesito un ejemplo desde codigo para hacer indice FTS de Ads o
Tambien me sirve algo similar en Indices Cdx nativos de Harbour, con busqueda "tipo" FTS.

Muchas gracias.
Dario Fernandez
FWH, Harbour, BCC, MySql & MariaDB, tData, Dbf/Cdx
VSCode.
Maldonado - Uruguay
User avatar
Giovany Vecchi
Posts: 129
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: Indice FTS en Ads o Cdx normal???

Post by Giovany Vecchi »

Ha varias maneiras de usar indices FTS

Code: Select all

Em SQL 

  AdsCreateSqlStatement("CLIENTES",3)
  (CLIENTES)->(AdsPrepareSQL("SELECT DISTINCT CLIENTE FROM CLIENTES WHERE CONTAINS(NOME,'EDUARDO SILVA')")
  (CLIENTES)->(AdsExecuteSQL())
  CLIENTES->(xBrowse())
  

Em Rdd Pure Harbour
  cAof := "CONTAINS(NOME,'EDUARDO SILVA')"
  USE CLIENTES ALIAS CLIENTES NEW
  CLIENTES->(AdssetAof(cAof))
  CLIENTES->(xBrowse())

Em Tads Rdd
  cAof := "CONTAINS(NOME,_NomePesquisa_)"
  aVars := {}
  aadd(aVars,{"_NomePesquisa_","EDUARDO SILVA"})
  oDb_Clientes := tAds():RddNew("CLIENTES")
  oDb_Clientes:Filter(cAof,aVars)
  (oDs_Clientes:cAlias)->(xBrowse())

Em Tads DataSet
  oDs_Clientes := tAds():DsNew(1)
  oDs_Clientes:cQrySql := "SELECT DISTINCT CLIENTE FROM CLIENTES WHERE CONTAINS(NOME,_NomePesquisa_)" 
  oDs_Clientes:DsAddVar("_NomePesquisa_","EDUARDO SILVA")
  oDs_Clientes:dsExecute()
  (oDs_Clientes:cAlias)->(xBrowse())  

 
D.Fernandez
Posts: 392
Joined: Wed Jul 31, 2013 1:14 pm
Location: Maldonado - Uruguay
Contact:

Re: Indice FTS en Ads o Cdx normal???

Post by D.Fernandez »

Excelente, Gracias.

En puro Harbour acepta AdsSetAof() ?
Em Rdd Pure Harbour
cAof := "CONTAINS(NOME,'EDUARDO SILVA')"
USE CLIENTES ALIAS CLIENTES NEW
CLIENTES->(AdssetAof(cAof))
CLIENTES->(xBrowse())

Saludos y gracias.
Dario Fernandez
FWH, Harbour, BCC, MySql & MariaDB, tData, Dbf/Cdx
VSCode.
Maldonado - Uruguay
Post Reply