lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Hellman <jhell...@innoventsolutions.com>
Subject Re: restricting a query by a "set" of field values
Date Mon, 29 Jul 2013 14:57:33 GMT
Ben,

This could be constructed as so:

fl=date_deposited&fq=date[2013-07-01T00:00:00Z TO 2013-07-31T23:59:00Z]&fq=collection_id(1
2 n)&q.op=OR

The parenthesis around the 1 2 n set indicate a boolean query, and we're ensuring they are
an OR boolean by the q.op parameter.

This should get you the result set you desire.  Please beware that a very large boolean set
(your IN(…) parameter) may be expensive to run.

Jason

On Jul 29, 2013, at 7:33 AM, Benjamin Ryan <benjamin.ryan@manchester.ac.uk> wrote:

> Hi,
>               Is it possible to construct a query in SOLR to perform a query that is
"restricted" to only those documents that have a field value in a particular set of values
similar to what would be done in POstgres with the SQL query:
> 
>               SELECT date_deposited FROM stats
>               WHERE date BETWEEN '2013-07-01 00:00:00' AND '2013-07-31 23:59:00'
>               AND collection_id IN (....)
> 
>               In my SOLR schema.xml date_deposited is a TrieDateField and collection_id
is an IntField
> 
> Regards,
>               Ben
> 
> ------------------------------------------------------------------
> Dr Ben Ryan
> Jorum Technical Manager
> 
> 5.12 Roscoe Building
> The University of Manchester
> Oxford Road
> Manchester
> M13 9PL
> Tel: 0160 275 6039
> E-mail: benjamin.ryan@manchester.ac.uk<https://outlook.manchester.ac.uk/owa/redir.aspx?C=b28b5bdd1a91425abf8e32748c93f487&URL=mailto%3abenjamin.ryan%40manchester.ac.uk>
> ------------------------------------------------------------------
> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message