-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
GroupedNot When used in the fluent API appears to still not work #182
Comments
Looks like a different issue all together, i'll have to add more tests for .And().GroupedNot You might be able to try the |
The other issue is really the Fluent API with "Not" becomes a little bit misleading since Or().GroupedNot would never make sense since that won't filter out anything. The Not functionality in lucene is a filter and means AND_NOT so in theory And().GroupedNot sort of makes sense but Or().GroupedNot doesn't. I suppose in a future major version the 'Not' filtering can be reviewed with how that might work better. I just found the work around to your issue though which is used in tests, you can build up the query like this too:
|
That's interesting because I can't actually do you work around as the code doesn't seem to allow: When I create the query:
It's generates an
My current work around is to manually add Not's using a loop, but it's not ideal. |
Ah, i see the work around is in tests because it casts to this type:
not ideal. I'll see what can be done correctly but won't be till next week sometime. |
I noticed the following didn't work when I have registered the field as integer. Otherwise if not defining the field as integer it works.
The raw lucene query: It seems I can use the following instead, when field is defined as integer.
|
When fields are typed (like numbers, etc...) they must be searched on accordingly otherwise lucene doesn't know what you are searching on which is why |
Hi @NikRimington, I've pushed tests here https://github.com/Shazwazza/Examine/blob/dev/src/Examine.Test/Search/FluentApiTests.cs#L680 and the result is correct. So either this issue is resolved in Examine, or I'm not setting up this test correctly. Any chance you would be able to clone this repo and run that test to make sure I haven't missed anything? |
Hey Shannon,
I've just updated to v1.0.5 using it in an Umbraco 8.6.4 site and I'm not sure that the changes you made to the GroupedNot method to fix #180, are being reflected when used in the fluent API.
I have the following code elements:
query in this case ends up as an IBooleanOperation, after this I have the following:
I have to use the
.And()
because IBooleanOperation doesn't have .GroupedNot directly available to it.This results in the following query:
Where as I think it should result in
Am I missing something in how I'm using the fluent API? Or is there still an issue around this type of query?
Cheers,
Nik
The text was updated successfully, but these errors were encountered: