lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Digy" <digyd...@gmail.com>
Subject RE: Is it generally a good idea to avoid using QueryParser if you know how to make the Query yourself?
Date Sat, 31 Oct 2009 08:24:27 GMT
I am not sure that I can understand what you exactly want to do but, you can
create an analyzer, get the output and then see what you can do with it.

StandardAnalyzer analyzer = new StandardAnalyzer();
TokenStream stream = analyzer.TokenStream("", new
System.IO.StringReader("your text"));
Token token = stream.Next();
while (  token !=null )
{
	Console.WriteLine(token.TermText());
	token = stream.Next();
}

DIGY

-----Original Message-----
From: Ron Grabowski [mailto:rongrabowski@yahoo.com] 
Sent: Saturday, October 31, 2009 2:55 AM
To: lucene-net-user@incubator.apache.org
Subject: Re: Is it generally a good idea to avoid using QueryParser if you
know how to make the Query yourself?

Is there a way to avoid using QueryParser altogether? I don't need all the
text parsed, I just want to run the name field through an analyzer and use
the output of that along with TermQuerys for the zip and city. I'm wanting
to do  ~2,500 specific searches on an index with between 26m documents. I
know ahead of time what most of my fields will be. I thought I could save
some time by not having to separate  my fields, making a giant string, then
having QueryParser split the string back into terms to search.




----- Original Message ----
From: Digy <digydigy@gmail.com>
To: lucene-net-user@incubator.apache.org
Sent: Fri, October 30, 2009 7:45:21 PM
Subject: RE: Is it generally a good idea to avoid using QueryParser if you
know how to make the Query yourself?

You can combine queries . (such as your custom "TermQuery" + the result of a
"QueryParser.Parse")

DIGY

-----Original Message-----
From: Ron Grabowski [mailto:rongrabowski@yahoo.com] 
Sent: Saturday, October 31, 2009 1:12 AM
To: lucene-net-user@incubator.apache.org
Subject: Is it generally a good idea to avoid using QueryParser if you know
how to make the Query yourself?

I can convert this text into a Query using  just TermQuery and BooleanQuery:

name:"ACME Produce" AND city:Anytown AND zip:90210

If I create the Query object on my own will I loose all the  benefits from
things like  StandardAnalyzer? Is there a way I can submit an object graph
to QueryParser so I can get the benefits of its analyzer without making it
parse the raw string? My input is coming from well defined areas; its not
free form where the user can enter anything they want.

Can I use a StandardAnalyzer myself then take its output and create the
appropriate Query objects then join all of them into a BooleanQuery?

I'm using /tags/Lucene.Net_2_4_0.


Mime
View raw message