; Question definition for a file based database.
; Lines starting from  ;  or  #  considered as comments.
; Please read the following sample configuration as example to start
;
; Use [Filters]    To select only the data you want. Every filter is assigned to a field.
;                  All filters must suttisfied in order to return data. 
;                  The Filters format is:  FIELD --> perl code
;                  The string DATA is replaced with field values.
; Use [Conditions] To fine grain what to return you can use Conditions. They are generic Perl code. You
;                  can use the field names to do something with them. Conditions are checked after filters.
;                  One condition can contain many different fields, multiple times. You can have multiple conditions.
;		   
; Never use [Conditions] if you can do the same thing with [Filters] because filters they can be as 1000 times faster.
;
;    [Filters]
;    SERVER_TARGET       --->    DATA eq 'host27'
;    THRO                --->    ( DATA > 100 ) and ( DATA < 400 )
;    bbss                --->   (( DATA > 100 ) and ( DATA < 400 )) or ( DATA =~/hello world/i )
;    FEEDBACK            --->   dATA =~/^[abc]/i
;    
;    [Conditions]
;    APPLICATION   eq uafrmval2
;    ( SERVER_TARGET =~ /192.*/ )   or   ( APPLICATION =~ /alt-http/ )
;
; Some usefull basic operators for filtering data at [Filters]  (there are much more)
;
;   eq                string equal
;   ne                string not equal
;   ==                number equal
;   !=                number not equal
;   >                 number greater
;   <                 number less
;   >=                number greater or equal 
;   <=                number less    or equal
;   gt                string greater
;   lt                string less
;   ge                string greater or equal 
;   le                string less    or equal 
;   uc                upper case
;   lc                lower case
;   =~/something/     like      case sensitive
;   =~/something/i    iike   no case sensitive


Schema file                                     = /work/FastDB test/db/Export cargo.schema
Fields to return                                = TYPE  WEIGHT  COUNTRY  COLOR
Results - print to standard output              = Yes
Results - print to standard error               = No
Results - print to an output file               = Yes
Results - output filename                       = /work/FastDB test/OUTPUT.TXT

# The following give you unbelievable flexibility and customization power
# to do something crazy at real time with the found data, while
# the question is still searching ! See the following example.
#
Results - Pass to external Perl module          = No
Results - Perl module name                      = MIME::Base64
Results - Function of the Perl module           = encode_base64
#Results - Code of how to pass data at function = @_                                          ( this is a clean pass )
#Results - Code of how to pass data at function = arg1, arg2, "someconnection string", @_     ( pass some extra arguments  ) 
#Results - Code of how to pass data at function = join ',', @_                                ( pass data as one string    )
Results - Code of how to pass data at function = join ',', @_



[Filters]
WEIGHT --> ( DATA > 800 ) and ( DATA < 8000 )
COLOR  --> dATA =~/(green|brown|red)/i
                      
[Conditions]
(WEIGHT >= 1500) and TYPE=~/2/
((COLOR eq "green") or (COLOR eq "red")) and (COUNTRY eq "U.S. MONTANA")
