Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8209069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:35:40+00:00 2026-06-07T09:35:40+00:00

I have an index, with a transformation: docs.FeedPosts .SelectMany(doc => (doc.Labels).DefaultIfEmpty(), (doc, docLabelsItem1) =>

  • 0

I have an index, with a transformation:

docs.FeedPosts
    .SelectMany(doc => (doc.Labels).DefaultIfEmpty(), (doc, docLabelsItem1) => new {AnnouncementGuid = doc.AnnouncementGuid, CreationDateUtc = doc.CreationWhenAndWhere.Time, FeedOwner = doc.FeedOwner, Key = doc.Key, Labels_Text = doc.Labels
    .Select(label => label.Text), SequentialId = ((long)doc.SequentialId), SubjectGuid = doc.SubjectGuid, SubjectId = doc.SubjectId})

(transform)

results
    .Select(doc => new {doc = doc, tags = Database.Load(doc.Key)})
    .Select(__h__TransparentIdentifier1 => new {AnnouncementGuid = __h__TransparentIdentifier1.tags.AnnouncementGuid, AreCommentsLocked = __h__TransparentIdentifier1.tags.AreCommentsLocked, Author = __h__TransparentIdentifier1.tags.Author, Comments = __h__TransparentIdentifier1.tags.Comments, CreationWhenAndWhere = __h__TransparentIdentifier1.tags.CreationWhenAndWhere, FeedOwner = __h__TransparentIdentifier1.tags.FeedOwner, Key = __h__TransparentIdentifier1.tags.Key, Labels = __h__TransparentIdentifier1.tags.Labels, MessageBody = __h__TransparentIdentifier1.tags.MessageBody, SequentialId = __h__TransparentIdentifier1.tags.SequentialId, SubjectGuid = __h__TransparentIdentifier1.tags.SubjectGuid, SubjectId = __h__TransparentIdentifier1.tags.SubjectId})

Which works for QUERYING the data. But if I then request statistics, I get back the wrong document count! (I Limit the query to 0 results, and request raven statistics).

It seem that because my document looks like this:

{
    Labels: [
    { Text: "label 1" }
    { Text: "label 2" }
    ]
}

Raven generates TWO index entries for this one document – If I look in the raven query tool, the first index contains the actual index data, the second index document is just completely empty.

If I have 3 labels in a document, it generates 3 index results… and my ‘count’ is 3 times what it should be.

Whats going on?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:35:42+00:00Added an answer on June 7, 2026 at 9:35 am

    I translated your index to the query syntax, because that is easier to look at:

    from doc in docs.FeedPosts
    from NOT_USING_THIS in doc.labels
    select new 
    {
        AnnouncementGuid = doc.AnnouncementGuid, 
        CreationDateUtc = doc.CreationWhenAndWhere.Time, 
        FeedOwner = doc.FeedOwner, 
        Key = doc.Key, 
        Labels_Text = doc.Labels.Select(label => label.Text), 
        SequentialId = ((long)doc.SequentialId), 
        SubjectGuid = doc.SubjectGuid, 
        SubjectId = doc.SubjectId}
    }
    

    The second from clause is the SelectMany() in your index, whose value you are not using
    If you’ll remove that and work on top of the root object, you won’t have this issue.

    The docs for this are:
    http://ravendb.net/docs/faq/skipped-results

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say we have index.php that has something like $randomObj = new rndObject; $_SESSION['object']
I have index action, that print 1) form for creating new Entity; 2) list
I have a template in joomla without index.php I only have index.html, css file,
i am using php 5.2.8 i have index.html, which loads LOAD.PHP from IFRAME. iframe
I have a index.php page that is the main page. All pages are included
I have an index.php for registration, a login.php as the registration handler. when the
I have an index array (x) of dates (datetime objects) and an array of
I have a index.py file which imports a few modules. I later import my
I have an Index Action: [HttpGet] public ActionResult Index (bool Myparam, ...) { if(Myparam)
I have a index.php file which loads (require) 2 different files based on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.