How about using below as a &q= parameter? With &df=OR
+openingtime:[* TO NOW] +closingtime[NOW TO *] (+*:* -openingtime[* TO *] -closingtime[* TO *]) http://search-lucene.com/m/TN2a3WgvyX/ --- On Tue, 3/22/11, Jan-Eirik B. Nævdal <jan-eirik.naev...@iterate.no> wrote: > From: Jan-Eirik B. Nævdal <jan-eirik.naev...@iterate.no> > Subject: Re: Problems with creating a query that matches all the documents I > want to display > To: "Jonathan Rochkind" <rochk...@jhu.edu> > Cc: "solr-user@lucene.apache.org" <solr-user@lucene.apache.org> > Date: Tuesday, March 22, 2011, 12:55 AM > Unfortunalty have I tried the OR > approach in the fq. > with the positive filter query first i get document 4, with > negative filter > query first i get none result, > This request gives me 1 reply > http://localhost:8983/solr/select/?q=*%3A*&version=2.2&start=0&rows=100&indent=on]&fq=obj_todate_dt%3A[*%20TO%20NOW]%20&fq=obj_todate_dt%3A[NOW%20TO%20* > ] > > same as this (but if %20 is used between OR it would not > give any hits) > > http://localhost:8983/solr/select/?q=*%3A*&version=2.2&start=0&rows=100&indent=on]&fq=obj_fromdate_dt%3A[*%20TO%20NOW]OR-obj_fromdate_dt%3A[*%20TO%20*]&fq=obj_todate_dt%3A[NOW%20TO%20*]OR-obj_todate_dt%3A[*%20TO%20* > ] > > > This does not give any result: > http://localhost:8983/solr/select/?q=*%3A*&version=2.2&start=0&rows=100&indent=on]&fq=-obj_fromdate_dt%3A[*%20TO%20*]ORobj_fromdate_dt%3A[*%20TO%20NOW]&fq=-obj_todate_dt%3A[*%20TO%20*]ORobj_todate_dt%3A[NOW%20TO%20* > ] > > > Testing both on 1.3 1.4 just to be sure, and changing > default operator to OR > Im running a standard solr 1.4.1 schema and just added > these to dynamic > fileds in the example docs, just to make it easy to test > for me. > > > On Mon, Mar 21, 2011 at 10:53 PM, Jonathan Rochkind <rochk...@jhu.edu>wrote: > > > You can put an actual OR in the fq (an fq, by default, > is in the > > solr-lucene query parser language). Might that achieve > what you want? > > > > &fq= -openingtime:[* TO *] OR openingtime:[* > TO NOW] > > &fq= -closingtime:[* TO *] OR > closingtime:[NOW TO *] > > > > Does that, or some variation of it, do what you need? > > > > > > On 3/21/2011 5:43 PM, Jan-Eirik B. Nævdal wrote: > > > >> Hi > >> Have this problem I tried to solve with filter > queries but I think I`m > >> stuck > >> now, and don't see a solution how to solve my > problem. > >> > >> My problem is that i want a result page that shows > those documents that > >> matches > >> these filter query fq=openingtime:[* TO NOW] , > fq=closingtime[NOW TO *] > >> for > >> the documents with limited time access > >> but i want also all documents that does not have > the fields openingtime > >> and > >> closingtime defined > >> like this filter query fq=-openingtime[* TO *] and > fq = -closingtime[* TO > >> *] > >> > >> Are there some solution that allows me to make a > "join" of these two > >> filter > >> queries, that supports pagination. > >> A client side "manual" join would not be the best > solution here because of > >> the system the results are displayed in. > >> > >> Simple example: > >> Document 1 : openingtime = 1545 1. May.2050 > closingtime 1453 1. June.2050 > >> //available in the future > >> Document 2: Does not have the fields > openingtime and closing time > >> Document 3 Does not have the > fields openingtime and closing time > >> Document 4 openingtime = 1545 1. May.2010 > closingtime 1453 1. June.2030 / > >> available now > >> > >> My result page should then show document 2,3 and 4 > but not document 1 > >> Can anyone point me in the direction how to solve > this > >> > >> > >> Technical information: > >> Solr 1.4.1 (is being ported from 1.3) (reasons for > going to 3.x would be > >> appreciated > >> Default operator: AND > >> Several different documents where one type should > only be displayed in the > >> results for a limited time. This information is > indexed as dates in that > >> type of document. > >> Those fields does not exist on the other documents > in the index. > >> Not any major changes in the schema.xml > >> A solr instance here can contain between 5K-10M > documents > >> > >> > >> > >> JanEirik > >> > >> > > > -- > Jan Eirik B. Nævdal > Solutions Engineer | +47 982 65 347 > Iterate AS | www.iterate.no > The Lean Software Development Consultancy >