Isidor,
I never saw the test suite before (shame on me). It will be VERY useful in
the future. Thank you very much!!
I have another question - maybe someone knows the answer:
It seems that CLucene is keeping stuff in memory between the open/close of
the IndexWriter object. For example, if you create a brand new index and
create a document in it with just the field "TEST" containing "TEST", and
right after inserting it you search in the index for "TEST:TEST", without
closing the IndexWriter object, it will never be found. But, if you close
the IndexWriter before searching, and then search, it will find it. So my
question is: is there a way to change that behavior? I'd like all changes to
the index to be "instant" and to be able to search for newly created
documents right after inserting them.
Thanks!
- Mike
aka...@gmail.com
On Thu, Sep 17, 2009 at 9:09 PM, Isidor Zeuner <cluc...@quidecco.de> wrote:
> Hi Mike,
>
> > Would you mind giving me a very quick example about how to use the
> > BooleanQuery with 2 fields?
> >
>
> Have a look at the BooleanQuery test suite [1], where plenty of 2
> field BooleanQuery instances are created. In your case, you will want
> to replace the BooleanClause::SHOULD parameter with
> BooleanClause::MUST (SHOULD will cause the query to match all
> documents which have either of the two fields, while MUST will require
> both).
>
> Generally, the test suite is a valuable source for code samples to use
> in own code. And if something is missing, feel free to send more test
> cases.
>
> Best regards,
>
> Isidor
>
> [1]
> http://clucene.git.sourceforge.net/git/gitweb.cgi?p=clucene/clucene;a=blob;f=src/test/search/test/search/TestBoolean.cpp;h=0ad11d87eec524eab41a279a5acbb85c39de59b0;hb=ec56f769465b3d51d5b9ceecf3a565d89b59e283
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> CLucene-developers mailing list
> CLucene-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/clucene-developers
>
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers