Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Facets and collections
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
James Crowley  
View profile  
 More options Jun 30 2012, 6:34 am
From: James Crowley <james.crow...@gmail.com>
Date: Sat, 30 Jun 2012 11:34:06 +0100
Local: Sat, Jun 30 2012 6:34 am
Subject: Facets and collections
If I have the following:

Event { type:"X", tags: ["tag1","tag2"] }

and an index like this:

from event in doc.events
from tag in event.Tags
select {
   event.type
   tag

}

using faceted search, I'm getting a count of 2 for type: "x" facet ?
Is this expected? I'm using .As<Event>() on the query, which gives me
distinct events in ToList(), but not for ToFacets(). How do I get it
to count only distinct documents?

Thanks!

James

--

---
James Crowley
CTO, FundApps - a new generation in financial services software -
http://www.fundapps.co/
Founder, developerFusion - the global developer community -
http://www.developerfusion.com/

linkedin: http://linkedin.com/in/jamescrowley
twitter: http://twitter.com/jamescrowley


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Warren  
View profile  
 More options Jun 30 2012, 12:02 pm
From: Matt Warren <mattd...@gmail.com>
Date: Sat, 30 Jun 2012 09:02:36 -0700 (PDT)
Local: Sat, Jun 30 2012 12:02 pm
Subject: Re: Facets and collections

inline

Yeah that's expected, faceted search just takes all the terms in the index
and gives you the count of how many times each term occurs

> I'm using .As<Event>() on the query, which gives me distinct events in
> ToList(), but not for ToFacets().

How do I get it to count only distinct documents?


Facet search doesn't really make sense alongside As, it works in a
different way from other queries.

If you want count of distinct events, you can change your index to this,
(it should work)

    from event in doc.events
    select {
       event.type
       event.Tags.SelectMany(t => t)
    }


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Jun 30 2012, 1:03 pm
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Sat, 30 Jun 2012 20:03:43 +0300
Local: Sat, Jun 30 2012 1:03 pm
Subject: Re: [RavenDB] Re: Facets and collections

Almost, you need:

from event in doc.events
    select {
       event.type
       tag = event.Tags
    }


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Crowley  
View profile  
 More options Jul 2 2012, 3:34 am
From: James Crowley <james.crow...@gmail.com>
Date: Mon, 2 Jul 2012 08:34:58 +0100
Local: Mon, Jul 2 2012 3:34 am
Subject: Re: [RavenDB] Re: Facets and collections
Thanks - I just skipped right past that option assuming it wouldn't
work! Perhaps stick in a collection to the example on
http://ravendb.net/docs/client-api/faceted-search ?

J

On 30 June 2012 18:03, Oren Eini (Ayende Rahien) <aye...@ayende.com> wrote:

--

---
James Crowley
CTO, FundApps - a new generation in financial services software -
http://www.fundapps.co/
Founder, developerFusion - the global developer community -
http://www.developerfusion.com/

linkedin: http://linkedin.com/in/jamescrowley
twitter: http://twitter.com/jamescrowley


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Jul 2 2012, 5:12 am
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Mon, 2 Jul 2012 12:12:44 +0300
Local: Mon, Jul 2 2012 5:12 am
Subject: Re: [RavenDB] Re: Facets and collections

Matt,
Can you add that doc?

On Mon, Jul 2, 2012 at 10:34 AM, James Crowley <james.crow...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Warren  
View profile  
 More options Jul 2 2012, 5:27 am
From: Matt Warren <mattd...@gmail.com>
Date: Mon, 2 Jul 2012 02:27:20 -0700 (PDT)
Local: Mon, Jul 2 2012 5:27 am
Subject: Re: [RavenDB] Re: Facets and collections

Yeah I'll update it and send a pull-request sometime in the next few days


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »