Changeset 6468


Ignore:
Timestamp:
02/02/10 14:19:19 (9 years ago)
Author:
mnagni
Message:

Implemented a a-la-Google query line parsing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery-API/trunk/MEDINDiscoveryService/src/main/java/ndg/services/discovery/model/SearchAgent.java

    r6465 r6468  
    286286                // if spaces are specified, these need to be turned into '&' 
    287287                // joins 
    288                 term = term.replaceAll("(\\w)(\\s+)([!\\w])", "$1 & $3"); 
     288                //term = term.replaceAll("([\\w\\(\\)])(\\s+)([!\\w\\(\\)])", "$1 & $3"); 
     289                term = term.replaceAll("(\\bAND\\b)|(\\band\\b)", "&"); 
     290                term = term.replaceAll("(\\bOR\\b)|(\\bor\\b)", "|"); 
     291                term = term.replaceAll("(\\bNOT\\b)|(\\bnot\\b)", "!"); 
    289292                fromSQL.append(", to_tsquery('" + term + "') AS query "); 
    290293                 
Note: See TracChangeset for help on using the changeset viewer.