lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hg...@cswebmail.com
Subject Re: Search Expansion
Date Fri, 02 Apr 2004 14:10:23 GMT
Thanks for the quick reply Erik,

so you mean rather than having 

subject:(term001 ... term800)

to send through the query parser

I should use 

(subject:term001 ... subject:term800)

to pass onto the searcher directly ?


I tried this as you can see in the following code
fragment:

	String line = myquery;
//	Query query = QueryParser.parse(line, "name",
analyzer);
	Query query = line;
	out = out + "Searching for: " + query.toString("name")
+"\n\n";
	Hits hits = searcher.search(query);

but get an error during compilation because the
searcher.search() method is expecting a type Query on
input, not String.

Casting 

Hits hits = searcher.search((Query)line);

did not work either - said types not convertible.

What should I do ??


Thanks for taking your time !

Holger
______________________________________________________

On Fri, 2 Apr 2004 08:40:35 -0500, Erik Hatcher wrote:

> 
> On Apr 2, 2004, at 4:30 AM, hgadm@cswebmail.com wrote:
> > Everything is working fine so far except that Lucene
> > creates an 'input string too long' error when I ask
> for
> > e.g. subject:(term001 ... term800).
> 
> I presume you're constructing a String and passing it
> to QueryParser?
> 
> Why not just construct a BooleanQuery with a lot of
> nested TermQuery's? 
>   That would bypass QueryParser and any oddities it
may
> introduce too.
> 
> 	Erik
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> lucene-dev-help@jakarta.apache.org

___________________________________________________
The ALL NEW CS2000 from CompuServe
 Better!  Faster! More Powerful!
 250 FREE hours! Sign-on Now!
 http://www.compuserve.com/trycsrv/cs2000/webmail/





---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message