Query Ignoring Take Value

Vote:
 

Just running a simple Find query as such:

                var results = query
                    .Take(12)
                    .GetContentResult();

But it only returns 10. Even though total matching is 60.

This means when I am doing my pagination as such

                var results = query
                    .Skip((skip - 1) * take)
                    .Take(take)
                    .GetContentResult();

It never gets all the results.

I've also noticed that if I do:

            var queryResult = query
                .Take(100)
                .GetContentResult();

I get 58 hits and 60 total matching, which doesn't feel right to me either!!

#226871
Edited, Aug 21, 2020 11:57
Vote:
 

As long as .Take(12) and .Take(100) yields different results, .Take() is not completely ignored.

Are you sure your Find index is up to date?

.Take(12)

...will take the 12 first from the index.


if two of those pages actually are deleted from the CMS, then...

.GetContentResult();

...will return only 10 hits.

Happens all the time in dev environments where multiple developers share and mix databases en find indexes.

#226875
Edited, Aug 22, 2020 9:59
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.