• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

the search criteria

 
Allen Chan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Could someone kindly explain to what degree should we take care of the search, such as
"DEST=XXX, Carrier='XXX'", and which fields should be allowed to use in the search ( I believe we have flight no, dest, org, price, day, flight time, etc.)
Thanks
 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am planning to provide search in two modes.
A textfield that'll take the key --- in my beta exam it'll be the subcontractor name. Alternately the user can fill the textfield with any value and choose from a combo box that contains the field names to match from. In that case partial and noncase-sensitive search will be performed.
This is because they wanted a flexible search mechanism.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

and which fields should be allowed to use in the search

Think of an implementation that does not need to know the "allowed fields" in advance. Rather, it will validate the field names in the criteria at run time, using the database itself.
Eugene.
 
Allen Chan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THanks. Well, that is what I did exactly, I stringTokenize the search criteria string, and parse the criteria value pair, question is
1. how to write the boolean comparison?
right now I hardcoded Values[0] coresponded to flight no, values[1] to org, but I think that is not acceptable,since db format might change in the future.
2. In the requirement it says
** the user should be able to select the origin and destination of the flight, to describe enter the string value any for the origin, destination, or both, so as to implement a wildcard like feature***
can I just put two combobox and satisfied this requirement?
Thanks.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

1. how to write the boolean comparison?
right now I hardcoded Values[0] coresponded to flight no, values[1] to org, but I think that is not acceptable,since db format might change in the future.

Think of a flexibile solution that will not require your code to change even if the database schema changes. All you need to do is get the index of a field that you are searhcing for.

2. In the requirement it says
** the user should be able to select the origin and destination of the flight, to describe enter the string value any for the origin, destination, or both, so as to implement a wildcard like feature***
can I just put two combobox and satisfied this requirement?

Yeah, that will do it.
Eugene.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic