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 query only return two of three documents from index #393

Open
bjarnef opened this issue Sep 13, 2024 · 3 comments
Open

Lucene query only return two of three documents from index #393

bjarnef opened this issue Sep 13, 2024 · 3 comments

Comments

@bjarnef
Copy link
Contributor

bjarnef commented Sep 13, 2024

We have the following Lucene query in an Umbraco project:

Category: null, LuceneQuery: {+(+__IndexType:courseinstance) +hideFromSearch:0 +(subjectCode:43541) +isCancelled:0 +(latestValidDate:[638617824000000000 TO 3155378975999990000])}

Which return two results, which page index 0 and page size 100:

image

But searching in Umbraco backoffice it return three results.

image

I don't see anything specific regarding the last document besides it is missing a city property.

When searching using Luke this didn't result any results:

+(+__IndexType:courseinstance) +hideFromSearch:0 +(subjectCode:43541) +isCancelled:0 +(latestValidDate:[638617824000000000 TO 3155378975999990000])

but without latestValidDate ranger query:

+(+__IndexType:courseinstance) +hideFromSearch:0 +(subjectCode:43541) +isCancelled:0

image

Anything specific that could prevent the last index item to be mapped to an ISearchResult?

Examine v3.3.0
Umbraco v13.4.1

@Shazwazza
Copy link
Owner

This will most likely all boil down to analyzers.

You'll need to describe exactly how your index is configured:

  • What analyzer is used
  • What field analyzers are used
  • ... how to replicate from scratch.

@bjarnef
Copy link
Contributor Author

bjarnef commented Sep 14, 2024

For this specific index it is using StandardAnalyzer.

I will see if I can find a way the replicate the issue, but I don't see any specific difference in the three indexed documents besides different values in the fields.

I also find it a bit strange that Luke return three results and Examine search from backoffice (IIRC this use ManageQuery).

@bjarnef
Copy link
Contributor Author

bjarnef commented Sep 15, 2024

I had a closer look at the index.

The items has the following latestValidDate:

638730144000000000 -> 2025-01-21​T00:00:00.000Z
638633376000000000 -> 2024-10-01​T00:00:00.000Z
638607456000000000 -> 2024-09-01​T00:00:00.000Z

https://tickstodatetime.azurewebsites.net/

and the query looks like this using DateTime.Now until DateTime.MaxValue:

+(+__IndexType:courseinstance) +hideFromSearch:0 +(subjectCode:43541) +isCancelled:0 +(latestValidDate:[638619552000000000 TO 3155378975999990000])

It seems to correct filter 2 items, but in Umbraco backoffice is doesn't seems the daterange filter has any effect.
E.g. this still return 3 results.

+(+__IndexType:courseinstance) +hideFromSearch:0 +(subjectCode:43541) +isCancelled:0 +(latestValidDate:[3155378975999990000 TO 3155378975999990000])

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

No branches or pull requests

2 participants