lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chad Small" <Chad.Sm...@definityhealth.com>
Subject RE: Searching in "all"
Date Thu, 01 Apr 2004 15:45:20 GMT
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:tate.avery@nstein.com] 
	Sent: Thu 4/1/2004 9:30 AM 
	To: lucene-user@jakarta.apache.org 
	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: lucene-user-unsubscribe@jakarta.apache.org
	For additional commands, e-mail: lucene-user-help@jakarta.apache.org
	
	

Mime
View raw message