-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use ASCII synonyms for non-ASCII characters #27
Merged
Merged
Conversation
This file contains 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
The headword field poses some problems for the new analyzer we are planning. The analyzer will contain a filter to replace non-ASCII characters with ASCII "synonyms". Some of these synonyms contain characters that the standard tokenizer strips out, therefore the filter cannot be used at the same time as that tokenizer. The headword field is unique in that it both contains non-ASCII characters and needs to be tokenized (to separate the guideword from the cuneiform and part of speech). This means that we would need some more complex way of indexing it. Fortunately, it contains the same information as gw and cf (as well as the part of speech, which we don't do anything with at the moment), so we don't lose anything by removing it from the search.
Currently only used for the cf field
The Index object exposes some methods of the index client (like put_mapping) but gives a higher-level abstraction, which will hopefully lead to more concise code.
It makes more sense there.
Version 7 of ElasticSearch has introduced some breaking changes, particularly the removal of document types. This will not be hard to adapt to (we only have one document type in our index anyway), but newer versions of the elasticsearch_dsl package have changed their API to follow this. As we mostly use ES 5/6 locally and in the Oracc server, for now we should stick to the previous version of the package.
This is needed or the tests that set up the mapping won't run.
Also, don't update/run ES on the PEP8 test instance
Earlier versions of elasticsearch_dsl set a default document type when creating an index. This leads to an error when we try to add the mapping for our own document type ("entry"), because an index can only have one type. This fix avoids this by passing the intended document type from the start. (This problems appears in versions including 6.2.1, but has been fixed by 6.4.0)
2 tasks
Merging this so we can start from a cleaner point. Remaining tasks noted in #32. |
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.
Will fix #18.
gw
,cf
,norms_n
andnorms_f
fields)headword
field (not necessary but removes duplication)cf.sort
behave as before, i.e. don't use the new analyzer