You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "Hiller, Dean x66079" <de...@broadridge.com> on 2011/06/20 17:54:34 UTC

any documentation on creating a query without query language

I would like to skip creating the query using the query language.  Our queries are simple and fixed
Like account = :account and strategy=:strategy and date > :date

So I would prefer maybe not to use a parser in the future sometime and am really just wondering how.

For now, I am just going to use the parser to get my stuff done but was just curious on how to form it manually if I wanted to.
Thanks,
Dean

This message and any attachments are intended only for the use of the addressee and
may contain information that is privileged and confidential. If the reader of the 
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.


RE: any documentation on creating a query without query language

Posted by "Hiller, Dean x66079" <de...@broadridge.com>.
Sweeeeet, thanks,
Dean

-----Original Message-----
From: Raf [mailto:r.ventaglio@gmail.com] 
Sent: Monday, June 20, 2011 11:34 AM
To: java-user@lucene.apache.org
Subject: Re: any documentation on creating a query without query language

You can always "create" your query by hand, using the various Query objects.

For example:
   BooleanQuery bq = new BooleanQuery();
   bq.add(new TermQuery(new Term("account", myAccount)), Occur.MUST);
   bq.add(new TermQuery(new Term("strategy", myStrategy)), Occur.MUST);
   bq.add(new TermQuery(new Term("account", myAccount)), Occur.MUST);
   bq.add(new TermRangeQuery("date", minDate, maxDate, false, false),
Occur.MUST);
and so on.

Bye
*Raf*



On Mon, Jun 20, 2011 at 5:54 PM, Hiller, Dean x66079 <
dean.hiller@broadridge.com> wrote:

> I would like to skip creating the query using the query language.  Our
> queries are simple and fixed
> Like account = :account and strategy=:strategy and date > :date
>
> So I would prefer maybe not to use a parser in the future sometime and am
> really just wondering how.
>
> For now, I am just going to use the parser to get my stuff done but was
> just curious on how to form it manually if I wanted to.
> Thanks,
> Dean
>
> This message and any attachments are intended only for the use of the
> addressee and
> may contain information that is privileged and confidential. If the reader
> of the
> message is not the intended recipient or an authorized representative of
> the
> intended recipient, you are hereby notified that any dissemination of this
> communication is strictly prohibited. If you have received this
> communication in
> error, please notify us immediately by e-mail and delete the message and
> any
> attachments from your system.
>
>
This message and any attachments are intended only for the use of the addressee and
may contain information that is privileged and confidential. If the reader of the 
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.


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


Re: any documentation on creating a query without query language

Posted by Raf <r....@gmail.com>.
You can always "create" your query by hand, using the various Query objects.

For example:
   BooleanQuery bq = new BooleanQuery();
   bq.add(new TermQuery(new Term("account", myAccount)), Occur.MUST);
   bq.add(new TermQuery(new Term("strategy", myStrategy)), Occur.MUST);
   bq.add(new TermQuery(new Term("account", myAccount)), Occur.MUST);
   bq.add(new TermRangeQuery("date", minDate, maxDate, false, false),
Occur.MUST);
and so on.

Bye
*Raf*



On Mon, Jun 20, 2011 at 5:54 PM, Hiller, Dean x66079 <
dean.hiller@broadridge.com> wrote:

> I would like to skip creating the query using the query language.  Our
> queries are simple and fixed
> Like account = :account and strategy=:strategy and date > :date
>
> So I would prefer maybe not to use a parser in the future sometime and am
> really just wondering how.
>
> For now, I am just going to use the parser to get my stuff done but was
> just curious on how to form it manually if I wanted to.
> Thanks,
> Dean
>
> This message and any attachments are intended only for the use of the
> addressee and
> may contain information that is privileged and confidential. If the reader
> of the
> message is not the intended recipient or an authorized representative of
> the
> intended recipient, you are hereby notified that any dissemination of this
> communication is strictly prohibited. If you have received this
> communication in
> error, please notify us immediately by e-mail and delete the message and
> any
> attachments from your system.
>
>