--- On Wed, 3/2/11, openvictor Open <openvic...@gmail.com> wrote: > From: openvictor Open <openvic...@gmail.com> > Subject: Searching all terms - SolrJ > To: solr-user@lucene.apache.org > Date: Wednesday, March 2, 2011, 12:20 AM > Dear all, > > First I am sorry if this question has already been asked ( > I am sure it > was...) but I can't find the right option with solrj. > > I want to query only documents that contains ALL query > terms. > Let me take an example, I have 4 documents that are simple > sequences ( they > have only one field : text ): > > 1 : The cat is on the roof > 2 : The dog is on the roof > 3 : The cat is black > 4 : the cat is black and on the roof > > if I search "cat roof" I will have doc 1,2,3,4 > In my case I would like to have only : doc 1 and doc 4 > (either cat or roof > don't appear in doc 2 and 3). > > Is there a simple way to do that automatically with SolrJ > or should I should > something like : > text:cat AND text:roof ? > > Thank you very much for your help !
You can use <solrQueryParser defaultOperator="AND"/> in your schema.xml