Compute an ngram field for all admin data #345
Closed
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.
This PR adds one new field per
parent.*
admin entry called, for exampleparent.locality_ngram
.It takes advantage of the
copy_to
operation in order to copy the admin name and admin abbreviation inputs for each record and adds them to the new ngram field.The ngram field is tokenized using the existing
peliasIndexOneEdgeGram
analyzer, so as to produce prefix-ngrams which can be used for autocomplete.The motivation here is to be able to, quite simply and efficiently, improve autocomplete queries which contain admin areas.
We currently only autocomplete on the
name.default
field and require full completion of the admin inputs before any effect is noticed in the results.I suspect the changes required for the queries (such as this) will be minimal.
Due to the way
addressit
works (splitting 'address parts' and 'admin parts') this should play well with the existing parsing logic.