Skip to content
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

Search using constraint with refinements times out #46

Closed
rlustemberg opened this issue Mar 30, 2023 · 6 comments
Closed

Search using constraint with refinements times out #46

rlustemberg opened this issue Mar 30, 2023 · 6 comments

Comments

@rlustemberg
Copy link

rlustemberg commented Mar 30, 2023

The Health Ministry from Argentina advises to use the following constraint when searching within generic medications: <763158003: 732943007 =*, [0..0] 774159003=*.
I've noticed that using such a constraint on the AR Edition of SNOMED causes the request to time out. Removing the second refinement reduce search time to around 15 secs (docker container on a i7 8core iMac). So it seems to be properly interpreting the ECL.
I wonder if this is an indexing issue. Except for this only problem, we are in awe regarding the performance of this terminology server. Orders of magnitude more performance and less footprint. Also the full text search with it's fuzzy fallback is amazing.

@wardle wardle closed this as completed in 85505b1 Mar 31, 2023
@wardle
Copy link
Owner

wardle commented Mar 31, 2023

Thanks for reporting this. I've fixed the ECL parsing to build a different query when a wildcard is used like this in a refinement when the wildcard is used as the value of an attribute. Instead of trying to realise all concepts (which is what a wildcard expression usually does), because this is in the context of a refinement, we can instead cheat and query for results with that attribute independent of the value. This means that the results will be fast.

However, I have not been able to test this with your full expression as I only have access to the UK edition. I'd be interested to know whether your full expression expands correctly, and whether you have tested this with any other terminology servers. It may be that the handling of a [0...0] cardinality attribute needs additional work.

@wardle
Copy link
Owner

wardle commented Mar 31, 2023

Re-opening as a cardinality of [0..0] not providing correct results. Looks like an easy fix however for this special case within parse-attribute--expression in which we'll have to turn it into a query to not include results with a count of the specified attribute(s).

@wardle wardle reopened this Mar 31, 2023
@wardle wardle closed this as completed in 72edd81 Apr 1, 2023
@wardle
Copy link
Owner

wardle commented Apr 1, 2023

Fixes included in v1.2.1032 release

@rlustemberg
Copy link
Author

Thank you so much. I'll do some tests and let you know how is it all working

@rlustemberg
Copy link
Author

Just tested locally. 45ms total response time. Headers response time 45ms. Processing time seems negligible. Great stuff!

@wardle
Copy link
Owner

wardle commented Apr 1, 2023

That's great to hear. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants