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 Seeta Somagani <Se...@xplana.com> on 2006/02/28 22:47:58 UTC

Inside a Boolean Query

Hi,

 

I need to return the context of the terms along with the results.

The approach that I'm using is to

1)       detect what kind of query it is, 

2)       extract the terms of the query, 

3)       fetch the context of the individual terms, and 

4)       finally join them depending on the query.

 

The problem is that all user entered queries are either PhraseQuerys,
BooleanQuerys, or TermQuerys.

PhraseQuerys and TermQuerys can easily be done, but the problem is with
a BooleanQuery.

I'm unable to find out what Querys make up the BooleanQuery. That
matters when there are a combination of Querys like a PhraseQuery and a
TermQuery inside the BooleanQuery. 

Is there a way that I can detect the composition of a BooleanQuery,
rather than just extract the individual terms?

 

Seeta


Re: Inside a Boolean Query

Posted by Yonik Seeley <ys...@gmail.com>.
On 2/28/06, Seeta Somagani <Se...@xplana.com> wrote:
> Is there a way that I can detect the composition of a BooleanQuery,
> rather than just extract the individual terms?

Hi Seeta,

I think BooleanQuery.getClauses() might be what you are looking for.

-Yonik

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