See MultiFieldQueryParser, like this:
 
String[] fields = getFieldsArray();
      Query multiFieldQuery = MultiFieldQueryParser.parse(this.queryString,
                                                          fields,
                                                          new StandardAnalyzer());
      System.out.println("multiFieldQuery: " + multiFieldQuery.toString());

        -----Original Message----- 
        From: Tate Avery [mailto:[EMAIL PROTECTED] 
        Sent: Thu 4/1/2004 9:30 AM 
        To: [EMAIL PROTECTED] 
        Cc: 
        Subject: Searching in "all"
        
        

        Hello,
        
        If I have, for example, 3 fields in my document (title, body, notes)... is 
there some easy what to search 'all'?
        
        
        Below are the only 2 ideas I currently have/use:
        
        1) If I want to search for 'x' in all, I do something like:
                title:x OR body:x OR notes:x
        
        ... but this does not really work if you are search for (a AND b) and a is in 
the title and b is in the notes, etc... leading to an explosion of boolean 
combinations it seems.
        
        
        2) Actually index an 'all' field for my document by just concatenating the 
content from the title, body, and notes fields.
        ... but this doubles my index size.  :(
        
        
        So, is there a better way out there?
        
        Thanks,
        Tate
        
        ---------------------------------------------------------------------
        To unsubscribe, e-mail: [EMAIL PROTECTED]
        For additional commands, e-mail: [EMAIL PROTECTED]
        
        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to