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 Siti Rochimah <si...@yahoo.com> on 2008/08/01 19:04:27 UTC

query API for program-generated query (please help..)

Hi,

I'm a new user for Lucene.

I would like to make search-engine program with program-generated query rather than user-input query. If anyone knows how to make a query API for this purpose, please share the code...
Thanks.

siti_r


      

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


Re: query API for program-generated query (please help..)

Posted by Siti Rochimah <si...@yahoo.com>.
yes, I have...
but, as far as I know.. to make a boolean query, we also have to make it by inputting a boolean expressions from the command line. 

All I want to do is making the query from textual file. I read file content, placing it in a string variable and passing it to the parser. 
But, in my experience, this variable is always detected as a null variable by the parser, even if the variable is containing some texts (can be displayed by system.out.printf().

This is messages that I have found from Lucene documentations:

"Although Lucene provides the ability to create your own queries through its API, it also provides a rich query language through the Query Parser, a lexer which interprets a string into a Lucene Query using JavaCC.
...
Before choosing to use the provided Query Parser, please consider the following:
1. If you are programmatically generating a query string and then parsing it with the query parser then you should seriously consider building your queries directly with the query API. In other words, the query parser is designed for human-entered text, not for program-generated text."


That's why I am searching for this kind of API...




--- On Sun, 8/3/08, Erick Erickson <er...@gmail.com> wrote:

> From: Erick Erickson <er...@gmail.com>
> Subject: Re: query API for program-generated query (please help..)
> To: java-user@lucene.apache.org, siti_r@yahoo.com
> Date: Sunday, August 3, 2008, 12:35 AM
> Have you looked at BooleanQuery?
> 
> Best
> Erick
> 
> On Fri, Aug 1, 2008 at 1:04 PM, Siti Rochimah
> <si...@yahoo.com> wrote:
> 
> > Hi,
> >
> > I'm a new user for Lucene.
> >
> > I would like to make search-engine program with
> program-generated query
> > rather than user-input query. If anyone knows how to
> make a query API for
> > this purpose, please share the code...
> > Thanks.
> >
> > siti_r
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail:
> java-user-help@lucene.apache.org
> >
> >


      

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


Re: query API for program-generated query (please help..)

Posted by Erick Erickson <er...@gmail.com>.
Have you looked at BooleanQuery?

Best
Erick

On Fri, Aug 1, 2008 at 1:04 PM, Siti Rochimah <si...@yahoo.com> wrote:

> Hi,
>
> I'm a new user for Lucene.
>
> I would like to make search-engine program with program-generated query
> rather than user-input query. If anyone knows how to make a query API for
> this purpose, please share the code...
> Thanks.
>
> siti_r
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>