Question about queries

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
ollabun
Posts: 5
Joined: Wed Apr 27, 2005 3:38 am

Question about queries

Post by ollabun »

How can I specify a query that looks for all names starting with the letter "B" and ending with the letter "O"?
aware_support
Posts: 7526
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Yes. "Starts with" and "Ends with" options are available in the standard interface when you define a query. You can also use STARTSWITH, ENDSWITH, CONTAINS constructs of the rule language, for example:
FIND Student WHERE Student.Name STARTSWITH 'B' AND Student.Name ENDSWITH 'O'
You can also use a number of functions that work with strings (see User Guide - Functions, or Context Assistant).
Aware IM Support Team
ollabun
Posts: 5
Joined: Wed Apr 27, 2005 3:38 am

Post by ollabun »

We don't know in advance what will be the Customer request.
At one moment he could want to find all students, whose last name starts on 'Y'
In the next moment he may want to find students whose name starts on 'A'
A query withy "A*" can help in this regard.
The question is this - can the Customer influence a query himself by providing regular expression (as a string) to the query?
Same way as you do search on some Web-site - you provide your regular expression for the search.
aware_support
Posts: 7526
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

At the moment we do not support regular expressions per se. What we usually do in these situations is configure a query that looks something like this:
FIND Student WHERE Student.Name CONTAINS ?'Name'. The query will search for students that have any characters entered by a user in their name. You can also configure a more elaborate query:

FIND Student WHERE Student.NAME STARTSWITH ?'Starts with symbols' AND Student.Name ENDSWITH ?'Ends with symbols' AND Student.Name CONTAINS ?'Contains symbols'

When a user runs such a query he will see 3 fields with prompts "Starts with symbols", "Ends with symbols" and "Contains symbols". He can enter anything into any of these fields. If he leaves any of the fields blank, the corresponding condition will be ignored. So it is really like regular expressions for dummies.
Aware IM Support Team
Post Reply