Search in multiple fields?

Search in multiple fields?

Post by Erik Chr. Bach » Mon, 11 Jun 2001 23:48:59



Is it possible to search in multiple fields at the same time?

EcB

 
 
 

Search in multiple fields?

Post by Bridget El » Tue, 12 Jun 2001 06:39:52


Hi Erik

Yes, although how you do it depends on the type of find you need to perform.

For an "or" type find (which finds ALL records which have ANY of the
search criteria): go to Find Mode, then insert the search string for each
field in the appropriate field in successive find requests (using New
Request command from the Mode Menu)

For an "and" type find (which find ONLY records which have ALL of the
search criteria): go to Find Mode, then insert the search string for each
field in the field concerned in a single find request.

Both "or" and "and" type requests can be scripted.  To make it easier on
users, you can create a special layout with a global field or fields into
which the user enters the search string or strings, then clicks a button
which runs a script which enters find mode, sets the relevant fields to
the value in the search string field or fields, then performs the find.  

Here is an example of a script that offers both "or" and "and" choices,
and which uses a global field for each normal field that is to be
searched. I have used three fields but you can use as many as you want.
If your objective is to search each field for the same value, a single
global field would suffice.

Find button:

Set Field [GlobalNumber, Status (CurrentLayoutNumber)]
Go to layout [Search]
Set Field [GlobalFieldA, ""]
Set Field [GlobalFieldB, ""]
Set Field [GlobalFieldC, ""]

Continue button:

If [IsEmpty (GlobalFieldA) and IsEmpty (GlobalFieldB) and IsEmpty
(GlobalFieldC)]
Show Message: "You have not entered  any search string in any field."
Buttons: "OK"
Exit Script
Else
Show Message: "Do you want to find all records with any of the search
strings or only records with all of the search strings?" Buttons: "Any",
"All", "Cancel"
If [Status(CurrentMessageChoice) = 1]
Perform Script [Subscript, "Any" Option]
Else
If [Status(CurrentMessageChoice) = 2]
Perform Script [Subscript, "All" Option]
End If
End If
End If

Sub-script: "Any" Option

Set Error Capture [On]
Enter Find Mode[]
Set Field [FieldA, GlobalFieldA]
New Record/Request
SetField [FieldB, GlobalField B]
New Record/Request
SetField [FieldC, GlobalField C]
Perform Script [Sub-script: ""Any" and "All" Options"]

Sub-script: "All" Option

Set Error Capture [On]
Enter Find Mode[]
SetField [FieldA, GlobalField A]
SetField [FieldB, GlobalField B]
SetField [FieldC, GlobalField C]
Perform Script [Sub-script: ""Any" and "All" Options"]

Sub-script: "Any" and "All" Options

Perform Find[]
If [Status(CurrentErrorMessage) = 401]
Show Message ["There are no records which match the current find request
or requests.
Modify Request or requests?"]
     Buttons: "Modify", "Cancel"
If [Status(CurrentMessageChoice) = 1]
Modify Last Find
Pause/Resume Script []
Perform Script [Sub-scripts,"Any" and "All" Options]
Else
Find All
Go to Layout [GlobalNumber]
End If
Else
If [Status(CurrentFoundCount) = 1]
Go to layout [GlobalNumber]
Else
Go to layout [List View]
End If
End If

Cancel Button:
Go to layout  [GlobalNumber]

Clear Button:
Set Field [GlobalFieldA, ""]
Set Field [GlobalFieldB, ""]
Set Field [GlobalFieldC, ""]

--
Bridget Eley



> Is it possible to search in multiple fields at the same time?

> EcB


 
 
 

Search in multiple fields?

Post by Louis Les » Tue, 12 Jun 2001 07:03:00


Yes, you can also do multiple find requests as well.  For example if you
have 3 phone number fields and are looking for the area code 310 you
would enter the find mode and go to phone1, type 310 press command-n for
new the go to phone2 and type 310 etc.

Lou


Quote:> Is it possible to search in multiple fields at the same time?

> EcB

 
 
 

1. Searching on multiple fields

I am new to the fulltext searching world and was wondering if it is good
practice to search on multiple fields within a table.  So far all the the
examples of the FREETEXT and CONTAINS show against one field. In our current
UI we a proposing that the user can enter values in up to four fields.  Is
this a valid approach?  If so should I use "AND" or "OR" between these
fields?

Thanks,
Dan

2. Performance Utilities for Fox (DOS)

3. SQL - search in multiple fields

4. Oracle Financials needed in Alexandria,VA

5. Search on multiple fields

6. Calling C program from stored procedure ... how?

7. Searching on Multiple fields

8. How do I insert non-printing characters in the INSERT statement?

9. Search in multiple fields

10. Search on multiple fields with CDML?

11. Searching multiple fields with the Excalibur search engine??

12. web one entry for multiple field search??multiple

13. searching multiple text fields