View Complete Thread | FoxWeb Forum Home
Search:
Date:    Msg ID:   
From:    Thread:   
Subject:   
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

THISFORM.ClearLog()

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

'FTSearch',;

THIS.Parent.txtSearchFieldList.Value,;

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

* Search failed

THISFORM.AddLogEntry('Search failed')

THIS.Parent.cmdViewResultSet.Enabled = .F.

ELSE

* 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'

&SelectStatement

ENDIF

ENDIF

IF USED('FTSearch')

USE IN FTSearch

ENDIF

* Display massages returned by the full-text object

IF THISFORM.oFullText.Errors.Count > 0

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

THISFORM.AddLogEntry(THISFORM.oFullText.Errors.Item(M.i).Description)

NEXT

ENDIF

 
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
support@foxweb.com email
Sent by Boudewijn lutgerink on 11/10/2015 03:16:24 PM:
here's the URL: https://www.youtube.com/watch?v=Lajf2MpBdUA
 
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 support@foxweb.com. If not, I suggest that you post it as an unlisted video on YouTube and send us the URL.
FoxWeb Support Team
support@foxweb.com 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?