-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fuzziness alignment for MatchQueryDescriptor #941
Conversation
Hey @andersosthus I really like this and agree the In regards to the changes in |
Thanks @gmarz I keep forgetting about the object initializers :\ So yeah, this will have to wait until 2.0 then. I'll fix those things with the |
No worries at all. Having to always be mindful of bwc can be a real PITA, and it's really easy to forget sometimes ;). That would be awesome, thanks again! |
That I didn't need after all, but I left in :)
All logic in ```FuzzinessConverterHelper.ReadJson()``` Tests that exercise both the ```FuzzinessConverter``` and ```MatchQueryJsonConverter``` to test ```FuzzinessConverterHelper```
I've updated the PR with some changes:
The only thing I really don't like, is the object manipulation in Also not sure if the |
Now the MatchQueryJsonConverter uses the FuzzinessConverter to deserialize IFuzziness. This removes the ugly object creation in FuzzinessConverter to get the object into a unified format.
Now I'm pretty happy with this :)
|
@andersosthus great work here- LGTM 👍 Thanks again for yet another awesome contribution! |
FYI this was merged in our 2.0 branch: |
Is this fix not applied on 1.7? is it only for 2.0.x versions? I would like to know if there is any workaround on 1.7 version because 2.0 version has a lot of changes and it will take so much time to upgrade from 1.7 to 2.0 and I see that it is not very stable. Can you please advise? thanks |
Allows a Match query to take one of the following for Fuzziness:
This matches the docs at http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-query.html#_boolean
I've seen that there are two ways this kind of fuzziness is implemented in Nest.
There is this style that's used in some of the Suggestors, like the FuzzySuggestDescriptor: https://github.com/elasticsearch/elasticsearch-net/blob/develop/src/Nest/DSL/Suggest/FuzzySuggestDescriptor.cs
And then there is another style, basically taking all fuzziness values and calling .ToString() on it so they can all fit in a String field. This is used in the FuzzyQueryDescriptor: https://github.com/elasticsearch/elasticsearch-net/blob/develop/src/Nest/DSL/Query/FuzzyQueryDescriptor.cs
I feel the IFuzziness way is cleaner :)
This PR does not break anything, since the signature still matches the old signature. The main thing I don't like is the changes I had to do to MatchQueryJsonConverter.cs, to have the Fuzziness deserialize properly. I see that there is a FuzzinessConverter already that does the same thing, but not sure how I could use that from the ReadJson in the MatchQueryJsonConverter.