Full text Search
Full text Search
How could I manage a full text search in the whole database like LOCATE but in all fields?
Regards
Otto
Regards
Otto
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany
Re: Full text Search
Otto,
Here is an example:
you can try the Hiper-Seek functions of xHarbour. That´s a very fast seek over all fields in dbf. But I don´t know, if it supports memo too.Otto wrote:How could I manage a full text search in the whole database like LOCATE but in all fields?
Regards
Otto
Here is an example:
Code: Select all
#INCLUDE "Fivewin.ch"
#include "dbinfo.ch"
//REQUEST RMDBFCDX
REQUEST DBFCDX
//REQUEST BMDBFCDX
PROCEDURE Main()
FIELD FIRST, LAST, STREET, CITY
LOCAL n, hs
rddSetDefault( "DBFCDX" )
// rddSetDefault( "BMDBFCDX" )
// if ascan( rddList(1), "RMDBFCDX" ) != 0
// rddSetDefault( "RMDBFCDX" )
// endif
// ? RddSetDefault ()
use test
hs := HS_INDEX( "test", "FIRST+LAST+STREET+CITY", 2, 0, , .T., 3 )
/* Look for all records which have 'SHERMAN' string inside */
HS_SET( hs, "SHERMAN" )
while ( n := HS_NEXT( hs ) ) > 0
dbgoto( n )
if HS_VERIFY( hs ) > 0
? rtrim( FIRST+LAST+STREET+CITY )
endif
enddo
// wait
/* Does RDD support Record Map Filters? */
// if dbinfo( DBI_RM_SUPPORTED )
/* if yest then let set filter for all records with 'SHERMAN'
word and look at them in browser */
HS_FILTER( hs, "SHERMAN" )
DbSetFilter( {|| "SHERMAN"}, "SHERMAN" )
dbgotop()
browse()
// endif
HS_CLOSE( hs )
CLOSE ALL
QUIT
RETURN
kind regards
Stefan
Stefan
Memoread
Hello Antonio,
I would like to use your solution.
But now I face the problem that some dbf files only return 4 or 5 bytes.
If I try to open the clients.dbf form the Fivewin sample this is the result:
local cText := MemoRead( "clientes.dbf" )
msginfo(ctext )
Otto,
At( cText, MemoRead( "file.dbf" ) )
once found, substract the DBF header size, and divide it by the record size
_________________
regards, saludos
Antonio Linares
I would like to use your solution.
But now I face the problem that some dbf files only return 4 or 5 bytes.
If I try to open the clients.dbf form the Fivewin sample this is the result:
local cText := MemoRead( "clientes.dbf" )
msginfo(ctext )
Otto,
At( cText, MemoRead( "file.dbf" ) )
once found, substract the DBF header size, and divide it by the record size
_________________
regards, saludos
Antonio Linares
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Hi Stefan,
I get a "Unresolved External _HB_FUN_HS_INDEX" error when I try to compile your test. According to the help file I need - xhb.lib - is that correct? I can't find that lib on my PC, and yet I have xHarbour? Any ideas as to what I am doing wrong?
Did you ever find out if the Hyperseek works on MEMO fields too?
Antonio, do you know how to get the memo offset from the DBF if I use your method? (in case Hyperseek doesn't work for MEMOs)
I get a "Unresolved External _HB_FUN_HS_INDEX" error when I try to compile your test. According to the help file I need - xhb.lib - is that correct? I can't find that lib on my PC, and yet I have xHarbour? Any ideas as to what I am doing wrong?
Did you ever find out if the Hyperseek works on MEMO fields too?
Antonio, do you know how to get the memo offset from the DBF if I use your method? (in case Hyperseek doesn't work for MEMOs)
Many thanks
Ollie.
Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie.
Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Ollie,
I guess that you could use:
DbInfo( DBI_BLOB_OFFSET )
http://www.ousob.com/ng/53guide/ng28fbc.php
and/or
DbFieldInfo( DBS_BLOB_OFFSET )
http://www.ousob.com/ng/53guide/ng25343.php
I guess that you could use:
DbInfo( DBI_BLOB_OFFSET )
http://www.ousob.com/ng/53guide/ng28fbc.php
and/or
DbFieldInfo( DBS_BLOB_OFFSET )
http://www.ousob.com/ng/53guide/ng25343.php