That should work fine, assuming that foo and bar are the untokenized
fields and content is the tokenized content.

Erick

On Jan 24, 2008 1:18 PM, <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I have an index with some fields which are indexed and un_tokenized
> (keywords) and one field which is indexed and tokenized (content).
>
> Now I want to create a Query-Object:
>
>        TermQuery k1 = new TermQuery(new Term("foo", "some foo"));
>        TermQuery k2 = new TermQuery(new Term("bar", "some bar"));
>        QueryParser p = new QueryParser("content", new
> SomeAnalyzer());//same analyzer is used for indexing
>        Query c =p.parse("text we are looking for");
>
>        BooleanQuery q = new BooleanQuery();
>        q.add(k1, Occur.MUST);
>        q.add(k2, Occur.MUST);
>        q.add(c, Occur.MUST);
>
> Is this the best way?
>
> Thank you
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to