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 Geert-Jan Brits <gb...@gmail.com> on 2010/06/02 14:09:17 UTC

Re: Regarding Facet Date query using SolrJ -- Not getting any examples to start with.

Hi Ninad,

SolrQuery q = new SolrQuery();
q.setQuery("*:*");
q.setFacet(true);
q.set("facet.data", "pub");
q.set("facet.date.start", "2000-01-01T00:00:00Z")
... etc.

basically you can completely build your entire query with the 'raw' set (and
add) methods.
The specific methods are just helpers.

So this is the same as above:

SolrQuery q = new SolrQuery();
q.set("q","*:*");
q.set("facet","true");
q.set("facet.data", "pub");
q.set("facet.date.start", "2000-01-01T00:00:00Z")
... etc.


Geert-Jan

2010/6/2 Ninad Raut <hb...@gmail.com>

> Hi,
>
> I want to hit the query given below :
>
>
> ?q=*:*&facet=true&facet.date=pub&facet.date.start=2000-01-01T00:00:00Z&facet.date.end=2010-01-01T00:00:00Z&facet.date.gap=%2B1YEAR
>
> using SolrJ. I am browsing the net but not getting any clues about how
> should I approach it.  How can SolJ API be used to create above mentioned
> Query.
>
> Regards,
> Ninad R
>

Re: Regarding Facet Date query using SolrJ -- Not getting any examples to start with.

Posted by Ninad Raut <hb...@gmail.com>.
Thanks Greet-Jan. Din't know about this trick. [?]

On Wed, Jun 2, 2010 at 5:39 PM, Geert-Jan Brits <gb...@gmail.com> wrote:

> Hi Ninad,
>
> SolrQuery q = new SolrQuery();
> q.setQuery("*:*");
> q.setFacet(true);
> q.set("facet.data", "pub");
> q.set("facet.date.start", "2000-01-01T00:00:00Z")
> ... etc.
>
> basically you can completely build your entire query with the 'raw' set
> (and
> add) methods.
> The specific methods are just helpers.
>
> So this is the same as above:
>
> SolrQuery q = new SolrQuery();
> q.set("q","*:*");
> q.set("facet","true");
> q.set("facet.data", "pub");
> q.set("facet.date.start", "2000-01-01T00:00:00Z")
> ... etc.
>
>
> Geert-Jan
>
> 2010/6/2 Ninad Raut <hb...@gmail.com>
>
> > Hi,
> >
> > I want to hit the query given below :
> >
> >
> >
> ?q=*:*&facet=true&facet.date=pub&facet.date.start=2000-01-01T00:00:00Z&facet.date.end=2010-01-01T00:00:00Z&facet.date.gap=%2B1YEAR
> >
> > using SolrJ. I am browsing the net but not getting any clues about how
> > should I approach it.  How can SolJ API be used to create above mentioned
> > Query.
> >
> > Regards,
> > Ninad R
> >
>