WGLab/PhenCards

Improve autocompletion

jimhavrilla opened this issue · 8 comments

This should be pretty easy for me to do. I can improve the indexing, add a better boosted query based on exact matching and prioritize results. I think Ngrams may improve this in the future, but for now, it should suffice.

Actually way harder than I thought, will discuss with Cong tomorrow.

Cong agrees that with my strategy, boost HPO in index.

To put together the solution to this took some effort but:

https://qbox.io/blog/enriching-your-elasticsearch-autocomplete-with-context-suggesters

elastic/elasticsearch#42776

and

https://www.elastic.co/guide/en/elasticsearch/reference/6.8/suggester-context.html

were very helpful.

So currently, as they are the most useful and official I have HPO boosted 3, ICD-10 2 and everything else 1.

Will index all other DBs and push soon.

Also trying to add dev properties to docker-compose.yml so the image will autoupdate the app in development.
https://www.patricksoftwareblog.com/using-docker-for-flask-application-development-not-just-production/

Fixed site, now is up-to-date. This is good to know: elastic/elasticsearch-py#715 for removing "localhost:9200" and replacing with "elasticsearch:9200".

Now https://phencards-dev.wglab.org is totally up-to-date and operational.

This has been completed with PR #71.