View Complete Thread | FoxWeb Forum Home
Date:    Msg ID:   
From:    Thread:   
The _TALLY variable will not necessarily be set to the correct value, which is why we provide the LastSearchTally property.
The return value of the Search method will tell you if the search had errors (regardless of whether it found any matches). The Errors property will give you additional information in the case of errors during search. The LastSearchTally property will return the number of records matching your search criteria.
  1. Are there 855 records that match the term "celeb*"? Do these get returned in the FTSearch cursor?
  2. What is the value of FTSearchResult after you call Search? If it's .F., then you should check the Errors property.  
FoxWeb Support Team email
Sent by Boudewijn lutgerink on 11/12/2015 07:08:40 AM:
I did create a small program file to check for the following.
First, here is the program code:
#define crlf CHR(13)+CHR(10)
oFullText = NEWOBJECT('classFullText', 'fwFullText9.fxp')
m.ofulltext.table = "tblArticles"
M.FTSearchResult = oFullText.Search(;
    'celeb*', ;
    'FTSearch', ;
MESSAGEBOX("oFullText.LastSearchTally returns "+TRANSFORM(oFullText.LastSearchTally)+crlf+;
" _Tally returns "+TRANSFORM(_tally))    
the weird thing is that _tally returns a value of 855 and  oFullText.LastSearchTally returns a value of 0.
My of the pants guess is that the search method performs a SQL select statement thus influencing the _tally system variable. (My guess is also based on the fact that a cursor is returned).
I always assume I overlook something when working with 3rd party software, so please tell me where I am wrong in my assumptions that oFullText.LastSearchTally is returning a wrong value.
Sent by FoxWeb Support on 11/11/2015 06:06:28 PM:
The fact that the Search method returned .T. does not mean that the search yielded results. This is what the LastSearchTally property is for. Search only returns .F. if there's an error.
Take a look at the code used by the sample form ftexample.scx:

LOCAL i, KeyField, TableAlias

* Perform search


IF NOT THISFORM.oFullText.Search(ALLTRIM(THIS.Parent.txtSearchPhrase.Value), ;



THISFORM.aSearchType(THIS.Parent.lstSearchType.Value, 2))

* Search failed

THISFORM.AddLogEntry('Search failed')

THIS.Parent.cmdViewResultSet.Enabled = .F.


* Search was successful (but may have yielded no matches)

THISFORM.AddLogEntry('Search yielded ' + TRANSFORM(THISFORM.oFullText.LastSearchTally) + ' records')

THIS.Parent.cmdViewResultSet.Enabled = (THISFORM.oFullText.LastSearchTally > 0)

* Replace search phrase with corrected version supplied by FullText object

THIS.Parent.txtSearchPhrase.Value = THISFORM.oFullText.LastCorrectedSearchPhrase

IF THISFORM.oFullText.LastSearchTally > 0

* Combine the result cursor with source table to view matches

* First retrieve key field name to use in select statement

THISFORM.oFullText.GetIndexAttributes(@M.KeyField,,) && We only care about the key field

M.TableAlias = JUSTSTEM(JUSTFNAME(THISFORM.oFullText.table))

* Construct select statement that joins result cursor with source table

SelectStatement = ;

' SELECT FTSearch.TotWords, FTSearch.Frequency, ' + M.TableAlias + '.*' + ;

' FROM ' + M.TableAlias + ;

' JOIN FTSearch ON FTSearch.IndexValue = ' + M.TableAlias + '.' + M.KeyField + ;

' ORDER BY FTSearch.TotWords DESC, FTSearch.Frequency DESC, ' + M.TableAlias + '.' + M.KeyField + ;

' INTO CURSOR SearchResults'




IF USED('FTSearch')



* Display massages returned by the full-text object

IF THISFORM.oFullText.Errors.Count > 0

FOR M.i = 1 TO THISFORM.oFullText.Errors.Count




Of course the fact that you use the wrong indicator to determine if the search yielded results does not explain why your wildcard search fails. You may want to use the example form with your own table to eliminate any errors in your search code. Just run the form and update the fields in the Create Index tab to select your own table.
Please post your findings here. 
FoxWeb Support Team email
Sent by Boudewijn lutgerink on 11/10/2015 03:16:24 PM:
here's the URL:
as you can see in the above video the only difference is the use of wildcards or not. When I do NOT use wildcards the crsSearch is found, when I do use wildcards the crsSearch is NOT found even though m.lSuccess returns .T.  
Sent by FoxWeb Support on 11/06/2015 07:57:32 PM:
How large is the video? If it's up to 20MB, you can send it via email to If not, I suggest that you post it as an unlisted video on YouTube and send us the URL.
FoxWeb Support Team email
Sent by Boudewijn lutgerink on 11/06/2015 06:54:26 AM:
 Working on my application I found a problem with doing searches with wildcards. I can make a video of it so you can see what I am doing and what I mean with it. Is there a way I send you this small video?