Feature/fuzzy match#321
Merged
gr0uch merged 4 commits intofortunejs:masterfrom Jun 23, 2020
Merged
Conversation
Works both directly on the attributes of a record and attributes
of (nested) relation of the record.
Due to filtering on these relations, the change was a bit more
complex.
The adapter instance needs to be passed down the whole chain of
matching, since extra queries need to occur to walk the path of
relations.
Extra note
----------
It somewhat assumes the last leaf in the path refers to an attribute
of a record. If it ends in a relation, this won't provide the results you
want as a user.
This will work:
```
store.find('user', undefined, {
fuzzyMatch: {
'name': 'john D'
'address:building:rooms:roomName': 'Room X'
}
}
)
```
This not:
```
store.find('user', undefined, {
fuzzyMatch: {
'name': 'john D'
'address:building': 'Building Y'
}
}
)
```
gr0uch
approved these changes
Jun 23, 2020
Member
gr0uch
left a comment
There was a problem hiding this comment.
I think a proper fuzzy match would use a string distance metric, but this will do lol.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See also: fortunejs/fortune-json-api#73
Works both directly on the attributes of a record and attributes
of (nested) relation of the record.
Due to filtering on these relations, the change was a bit more
complex.
The adapter instance needs to be passed down the whole chain of
matching, since extra queries need to occur to walk the path of
relations.
Extra Notes
leaf must refer to attribute
It somewhat assumes the last leaf in the path refers to an attribute
of a record. If it ends in a relation, this won't provide the results you
want as a user.
This will work:
This not:
interface in the options object
The options object
might be debatable. I understand
is more uniform. But adds some complexity implementation wise. Let me know what you think.