You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Israel Ekpo <is...@gmail.com> on 2009/12/09 19:08:18 UTC

SolrQuerySyntax : Types of Range Queries in Solr 1.4

Hi Guys,

In Lucene 2.9 and Solr 1.4, it is possible to perform inclusive and
exclusive range searches with square and curly brackets respectively.

However, when I looked at the SolrQuerySyntax, only the the include range
search is illustrated.

It seems like the examples only talk about the inclusive range searches.

http://wiki.apache.org/solr/SolrQuerySyntax

Illustrative example:

There is a field in the index name 'year' and it contains the following
values :

2000, 2004, 2005, 2006, 2007, 2008, 2009, 2010

year:[2005 TO 2009] will match 2005, 2006, 2007, 2008, 2009 [inclusive with
square brackets]
year:{2005 TO 2009} will only match 2006, 2007, 2008 {exclusive with curly
brackets}. The bounds are not included.

Is there any other page on the wiki where there are examples of exclusive
range searches with curly brackets?

If not I would like to know so that I can add some examples to the wiki.

Thanks.

-- 
"Good Enough" is not good enough.
To give anything less than your best is to sacrifice the gift.
Quality First. Measure Twice. Cut Once.
http://www.israelekpo.com/

Re: SolrQuerySyntax : Types of Range Queries in Solr 1.4

Posted by Israel Ekpo <is...@gmail.com>.
On Wed, Dec 9, 2009 at 1:13 PM, Yonik Seeley <yo...@lucidimagination.com>wrote:

> Solr standard query syntax is an extension of Lucene query syntax, and
> we reference that on the page:
> http://lucene.apache.org/java/2_4_0/queryparsersyntax.html
>
> -Yonik
> http://www.lucidimagination.com
>
> On Wed, Dec 9, 2009 at 1:08 PM, Israel Ekpo <is...@gmail.com> wrote:
> > Hi Guys,
> >
> > In Lucene 2.9 and Solr 1.4, it is possible to perform inclusive and
> > exclusive range searches with square and curly brackets respectively.
> >
> > However, when I looked at the SolrQuerySyntax, only the the include range
> > search is illustrated.
> >
> > It seems like the examples only talk about the inclusive range searches.
> >
> > http://wiki.apache.org/solr/SolrQuerySyntax
> >
> > Illustrative example:
> >
> > There is a field in the index name 'year' and it contains the following
> > values :
> >
> > 2000, 2004, 2005, 2006, 2007, 2008, 2009, 2010
> >
> > year:[2005 TO 2009] will match 2005, 2006, 2007, 2008, 2009 [inclusive
> with
> > square brackets]
> > year:{2005 TO 2009} will only match 2006, 2007, 2008 {exclusive with
> curly
> > brackets}. The bounds are not included.
> >
> > Is there any other page on the wiki where there are examples of exclusive
> > range searches with curly brackets?
> >
> > If not I would like to know so that I can add some examples to the wiki.
> >
> > Thanks.
> >
> > --
> > "Good Enough" is not good enough.
> > To give anything less than your best is to sacrifice the gift.
> > Quality First. Measure Twice. Cut Once.
> > http://www.israelekpo.com/
> >
>


Hi Yonik,

I saw that.

I posted the question because someone asked me how to do the exclusive
search where the bounds are excluded.

Initially they started with field:[lower-1 TO upper-1] and then I just told
them to use curly brackets so when I came to the Solr wiki to do a search I
did not see any examples with the curly brackets.

For me this was very obvious, but I think it would be nice to add a few
examples with curly brackets to the SolrQuerySyntax examples because most
people that are using Solr for the very first time may not have heard of or
used Lucene before.

Just a thought.

-- 
"Good Enough" is not good enough.
To give anything less than your best is to sacrifice the gift.
Quality First. Measure Twice. Cut Once.
http://www.israelekpo.com/

Re: SolrQuerySyntax : Types of Range Queries in Solr 1.4

Posted by Yonik Seeley <yo...@lucidimagination.com>.
Solr standard query syntax is an extension of Lucene query syntax, and
we reference that on the page:
http://lucene.apache.org/java/2_4_0/queryparsersyntax.html

-Yonik
http://www.lucidimagination.com

On Wed, Dec 9, 2009 at 1:08 PM, Israel Ekpo <is...@gmail.com> wrote:
> Hi Guys,
>
> In Lucene 2.9 and Solr 1.4, it is possible to perform inclusive and
> exclusive range searches with square and curly brackets respectively.
>
> However, when I looked at the SolrQuerySyntax, only the the include range
> search is illustrated.
>
> It seems like the examples only talk about the inclusive range searches.
>
> http://wiki.apache.org/solr/SolrQuerySyntax
>
> Illustrative example:
>
> There is a field in the index name 'year' and it contains the following
> values :
>
> 2000, 2004, 2005, 2006, 2007, 2008, 2009, 2010
>
> year:[2005 TO 2009] will match 2005, 2006, 2007, 2008, 2009 [inclusive with
> square brackets]
> year:{2005 TO 2009} will only match 2006, 2007, 2008 {exclusive with curly
> brackets}. The bounds are not included.
>
> Is there any other page on the wiki where there are examples of exclusive
> range searches with curly brackets?
>
> If not I would like to know so that I can add some examples to the wiki.
>
> Thanks.
>
> --
> "Good Enough" is not good enough.
> To give anything less than your best is to sacrifice the gift.
> Quality First. Measure Twice. Cut Once.
> http://www.israelekpo.com/
>