Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lucene cannot return more than 500 results no matter what QueryOptions "take" value is used #10931

Closed
argentini opened this issue Aug 24, 2021 · 5 comments

Comments

@argentini
Copy link

Which exact Umbraco version are you using? For example: 8.13.1 - don't just write v8

v9 rc002

Bug summary

Lucene cannot return more than 500 results no matter what QueryOptions "take" value is used.

Specifics

No response

Steps to reproduce

An example of this is below. Using int.MaxValue, or some other value above 500, only returns up to 500 results.

if (ExamineManager.TryGetIndex("ExternalIndex", out var index) || !(index is { } umbIndex))
{
    throw new InvalidOperationException($"No index found by name ExternalIndex or is not of type {typeof(IUmbracoIndex)}");
}

var searcher = (BaseLuceneSearcher)umbIndex.Searcher;

var luceneOptions = new LuceneSearchOptions
{
    AllowLeadingWildcard = true
};

var qry = searcher.CreateQuery("content", BooleanOperation.And, searcher.LuceneAnalyzer, luceneOptions).NativeQuery(luceneQuery);
var results = qry.Execute(new QueryOptions(0, int.MaxValue));

Expected result / actual result

As with Umbraco v8, it should return more than 500 results.

@nul800sebastiaan
Copy link
Member

@argentini It looks like this duplicates Shazwazza/Examine#234 - This should have been fixed with beta152. Can you check which version of Examine you're running?

RC2 depends on a newer version, beta 154 so you have the fix:

image

@argentini
Copy link
Author

Thanks @nul800sebastiaan - I'm using Examine 2.0 beta 154. I also tried installing beta 156 (latest available) and there was no change.

Screen Shot 2021-08-24 at 8 05 04 PM

@nul800sebastiaan
Copy link
Member

Interesting, I don't see why it wouldn't work but I don't have a v9 site with 900 nodes to test at the moment. In that case it might still be an issue in Examine and I would encourage you to report it on that tracker. In the mean time, maybe qry.Execute(QueryOptions.SkipTake(0, int.MaxValue)) could work?

Anyway, make sure to report and maybe you can even attach the source code and do a little debugging yourself! 🤞

I'll close this now, as it needs to be fixed in Examine :-)

@argentini
Copy link
Author

For the record I did try that already and got the same result.

@argentini
Copy link
Author

@nul800sebastiaan FYI I posted this issue for @Shazwazza and he already made the fix in the Examine repository. I'm not sure when or if it will find its way into a beta prior to the release of Umbraco 9. Maybe he can weigh in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants