lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alvaro Cabrerizo <topor...@gmail.com>
Subject Re: Newly observed Facets
Date Tue, 20 Jan 2015 17:47:49 GMT
Hi,

In case your data looks like:

"id": "1",
"userName": "one",
"startTimeISO": "2015-01-20T17:24:32.888Z"

"id": "2",
"userName": "one",
"startTimeISO": "2015-01-16T17:24:50.208Z"

"id": "3",
"userName": "two",
"startTimeISO": "2015-01-20T17:25:06.109Z"


You could use the next query combination

q=*:*
fq=startTimeISO:[NOW-1DAY TO NOW]  //this will give you all the users that
were seen today
fq=-_query_:"{!join from=userName to=userName}startTimeISO:[NOW-30DAYS TO
NOW-1DAYS]"  //dont include those documents that have others with the same
name and were viewed during the last 30 days.

Regards.









On Tue, Jan 20, 2015 at 5:32 PM, harish singh <harish.singh22@gmail.com>
wrote:

> Well, that is the problem I am facing. Just checking if there is a way to
> compute the diff from 18th for the 19th.
> One option is:
> Get all the facets for 19th.
> Get all facets for 18th.
> Do a diff and Eliminate intersection.
>
> But this isn't optimal as the number of facets returned but solr query can
> be huge.
>
> Any other way to get around with? Any tool that solr provides?
>
> On Tue, Jan 20, 2015, 8:10 AM Shawn Heisey <apache@elyograg.org> wrote:
>
> > On 1/20/2015 8:52 AM, harish singh wrote:
> > > Yes I got that. But I am still stuck at this point. Consider it like
> > this:
> > > I do not know what are the usernames in all the documents.
> > > I only know there is time associated with each record.
> > >
> > > So Say, I have usernames "a", "b", "c", "d" present in my data for the
> > 18th
> > > of January.
> > > And for the 19th, I have usernames "a", "b","c", "d", "e".
> > > Then my query for newly observed username for today over last two days
> > > should return me "e"
> >
> > If you query for only documents that match the 19th, and those documents
> > contain all five usernames, you're going to get all five usernames in
> > your facet.  Solr has no way to know that the other four usernames
> > should be excluded - it can only show you facets for the documents
> > matching your query, the other documents in your index will have no
> > bearing on the results.
> >
> > Thanks,
> > Shawn
> >
> >
>

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