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

  • SEARCH
  • Home
  • 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 7898737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:30:54+00:00 2026-06-03T08:30:54+00:00

I have a basic schema Post { Labels: [ { Text: Mine } {

  • 0

I have a basic schema

Post {
    Labels: [
        { Text: "Mine" }
        { Text: "Incomplete" }
    ]
}

And I am querying raven, to ask for all posts with BOTH “Mine” and “Incomplete” labels.

queryable.Where(candidate => candidate.Labels.Any(label => label.Text == "Mine"))
    .Where(candidate => candidate.Labels.Any(label => label.Text == "Incomplete"));

This results in a raven query (from Raven server console)

Query: (Labels,Text:Incomplete) AND (Labels,Text:Mine)
Time: 3 ms
Index: Temp/XWrlnFBeq8ENRd2SCCVqUQ==
Results: 0 returned out of 0 total.

Why is this? If I query for JUST containing “Incomplete”, I get 1 result.
If I query for JUST containing “Mine”, I get the same result – so WHY where I query for them both, I get 0 results?

EDIT:

Ok – so I got a little further. The ‘automatically generated index’ looks like this

from doc in docs.FeedAnnouncements
from docLabelsItem in ((IEnumerable<dynamic>)doc.Labels).DefaultIfEmpty()
select new { CreationDate = doc.CreationDate, Labels_Text = docLabelsItem.Text }

So, I THINK the query was basically testing the SAME label for 2 different values. Bad.

I changed it to this:

from doc in docs.FeedAnnouncements
from docLabelsItem1 in ((IEnumerable<dynamic>)doc.Labels).DefaultIfEmpty()
from docLabelsItem2 in ((IEnumerable<dynamic>)doc.Labels).DefaultIfEmpty()
select new { CreationDate = doc.CreationDate, Labels1_Text = docLabelsItem1.Text, Labels2_Text = docLabelsItem2.Text }

Now my query (in Raven Studio) Labels1_Text:Mine AND Labels2_Text:Incomplete WORKS!

But, how do I address these phantom fields (Labels1_Text and Labels2_Text) when querying from Linq?

  • 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-03T08:30:55+00:00Added an answer on June 3, 2026 at 8:30 am

    Adam,
    You got the reason right. The default index would generate 2 index entries, and your query is executing on a single index entry.

    What you want is to either use intersection, or create your own index like this:

    from doc in docs.FeedAnnouncements
    select new { Labels_Text = doc.Labels.Select(x=>x.Text)}
    

    And that would give you all the label’s text in a single index entry, which you can execute a query on.

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

Sidebar

Related Questions

I've got a very basic database schema and have created a dbml from it.
I have basic generalisation schema in database, I have superclass vehicle, and its subclases
I'm a total Ruby/Rails/AR noob. I have a very basic sort of database schema
I have a really basic question on SQL. Relational Schema: Student (Sid, Sname )
I have basic idea on Kilo Virtual Machine on Mobiles , I have clear
I have basic hello word example of Prime Faces. I have created dynamic web
I have a basic class that derived subclasses inherit from, it carries the basic
I have a basic question, in the Django template language how can you tell
I have the basic code to rewrite a subdomain to another page. But how
I have a basic has_many :through relationship that is bi-directional: calendars have many calendar_calendar_events

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.