Search creates a Lucene search index for descriptions.
Search creates a Lucene search index for descriptions.
(boost-length-query q)
Returns a new query with scores boosted by the inverse of the length
Returns a new query with scores boosted by the inverse of the length
(build-search-index store-filename search-filename language-priority-list)
Build a search index using the SNOMED CT store at store-filename
.
Build a search index using the SNOMED CT store at `store-filename`.
(do-query-for-concepts searcher query)
(do-query-for-concepts searcher query max-hits)
Perform the query, returning results as a set of concept identifiers
Perform the query, returning results as a set of concept identifiers
(do-query-for-results searcher q)
(do-query-for-results searcher q max-hits)
(do-search searcher
{:keys [max-hits fuzzy fallback-fuzzy remove-duplicates?]
:as params})
Perform a search against the index. Parameters:
keyword | description (default) |
---|---|
:s | search string to use |
:max-hits | maximum hits (if omitted returns unlimited but |
unsorted results) | |
:fuzzy | fuzziness (0-2, default 0) |
:fallback-fuzzy | if no results, try fuzzy search (0-2, default 0). |
:query | additional ^Query to apply |
:show-fsn? | show FSNs in results? (default, false) |
:inactive-concepts? | search descriptions of inactive concepts? (false) |
:inactive-descriptions? | search inactive descriptions? (default, true) |
:remove-duplicates? | remove duplicate results (default, false) |
:properties | a map of properties and their possible values. |
:concept-refsets | a collection of refset ids to limit search |
The properties map contains keys for a property and then either a single identifier or vector of identifiers to limit search.
Example: to search for neurologist as an occupation ('IS-A' '14679004')
(do-search searcher {:s "neurologist" :properties {snomed/IsA [14679004]}})
A FSN is a fully-specified name and should generally be left out of search.
Perform a search against the index. Parameters: - searcher : the IndexSearcher to use - params : a map of search parameters, which are: | keyword | description (default) | |--------------------- |---------------------------------------------------| | :s | search string to use | | :max-hits | maximum hits (if omitted returns unlimited but | | | *unsorted* results) | | :fuzzy | fuzziness (0-2, default 0) | | :fallback-fuzzy | if no results, try fuzzy search (0-2, default 0). | | :query | additional ^Query to apply | | :show-fsn? | show FSNs in results? (default, false) | | :inactive-concepts? | search descriptions of inactive concepts? (false) | | :inactive-descriptions? | search inactive descriptions? (default, true) | | :remove-duplicates? | remove duplicate results (default, false) | | :properties | a map of properties and their possible values. | | :concept-refsets | a collection of refset ids to limit search | The properties map contains keys for a property and then either a single identifier or vector of identifiers to limit search. Example: to search for neurologist as an occupation ('IS-A' '14679004') ``` (do-search searcher {:s "neurologist" :properties {snomed/IsA [14679004]}}) ``` A FSN is a fully-specified name and should generally be left out of search.
(duplicate-result? {a-concept-id :conceptId a-term :term}
{b-concept-id :conceptId b-term :term})
Are the given results, in effect, duplicates? This matches a result if they have the same conceptId and same term.
Are the given results, in effect, duplicates? This matches a result if they have the same conceptId and same term.
(extended-description->document ed)
Turn an extended description into a Lucene document.
Turn an extended description into a Lucene document.
(q-ancestorOf store concept-id)
A query for concepts that are ancestors of the specified concept.
A query for concepts that are ancestors of the specified concept.
(q-ancestorOrSelfOf store concept-id)
A query for concepts that are ancestors of the specified concept plus the concept itself.
A query for concepts that are ancestors of the specified concept plus the concept itself.
(q-and queries)
Generate a logical conjunction of the queries. If there is more than one query, and one of those queries contains a single 'must-not' clause, it is flattened (re-written) into the new query.
Generate a logical conjunction of the queries. If there is more than one query, and one of those queries contains a single 'must-not' clause, it is flattened (re-written) into the new query.
(q-any)
Returns a query that returns 'any' concept.
Returns a query that returns 'any' concept.
(q-attribute-count property minimum maximum)
A query for documents for a count direct properties (parent relationships) of the type specified. Parameters
For example, get concepts with 4 or more active ingredients:
(q-attribute-count 127489000 4 Integer/MAX_VALUE)
A query for documents for a count direct properties (parent relationships) of the type specified. Parameters - property : concept-id of the attribute - minimum : minimum count - maximum : maximum count (use Integer/MAX_VALUE for half-open range) For example, get concepts with 4 or more active ingredients: ``` (q-attribute-count 127489000 4 Integer/MAX_VALUE) ```
(q-attribute-descendantOrSelfOf property value)
Returns a query constraining to documents with the specified property and value. It uses the 'descendantOrSelfOf' constraint.
Returns a query constraining to documents with the specified property and value. It uses the 'descendantOrSelfOf' constraint.
(q-attribute-exactly-equal property value)
A query for documents with the property exactly equal to the value.
Usually, it would be more appropriate to use q-attribute-descendantOrSelfOf
.
A query for documents with the property exactly equal to the value. Usually, it would be more appropriate to use `q-attribute-descendantOrSelfOf`.
(q-childOf concept-id)
A query for direct (proximal) children of the specified concept.
A query for direct (proximal) children of the specified concept.
(q-childOrSelfOf concept-id)
A query for direct (proximal) children of the specified concept plus the concept itself.
A query for direct (proximal) children of the specified concept plus the concept itself.
(q-concept-ids concept-ids)
Returns a query that will return documents for the concepts specified.
Returns a query that will return documents for the concepts specified.
(q-descendantOf concept-id)
Returns a query that matches descendants of the specified concept.
Returns a query that matches descendants of the specified concept.
(q-descendantOrSelfOf concept-id)
Returns a query that matches descendants of the specified concept plus the specified concept itself.
Returns a query that matches descendants of the specified concept plus the specified concept itself.
(q-memberOf refset-id)
A query for concepts that are referenced by the given reference set.
A query for concepts that are referenced by the given reference set.
(q-memberOfInstalledReferenceSet store)
A query for concepts that are a member of any reference set.
A query for concepts that are a member of any reference set.
(q-not q1 q2)
Returns the logical query of q1 NOT q2
Returns the logical query of q1 NOT q2
(q-or queries)
Generate a logical disjunction of the queries. If there is more than one query, and one of those queries contains a single 'must-not' clause, it is flattened (re-written) into the new query. As this is an 'or' operation, that means it will be combined with a 'match-all-documents'.
Generate a logical disjunction of the queries. If there is more than one query, and one of those queries contains a single 'must-not' clause, it is flattened (re-written) into the new query. As this is an 'or' operation, that means it will be combined with a 'match-all-documents'.
(q-self concept-id)
Returns a query that will only return documents for the concept specified.
Returns a query that will only return documents for the concept specified.
(remove-duplicates equality-fn)
(remove-duplicates equality-fn coll)
Returns a lazy sequence removing consecutive duplicates in coll with
duplicates determined by equality function equality-fn
.
Returns a transducer when no collection is provided.
Also see [[clojure.core/dedupe]].
Returns a lazy sequence removing consecutive duplicates in coll with duplicates determined by equality function `equality-fn`. Returns a transducer when no collection is provided. Also see [[clojure.core/dedupe]].
(rewrite-query query)
Rewrites a query separating out any top-level 'inclusions' from 'exclusions'. Returns a vector of two queries inclusions and the exclusions. Exclusions will be rewritten from MUST_NOT to MUST. Useful in a situation where exclusions need to be applied independently to a substrate and the NOT will be specified in a parent clause.
Rewrites a query separating out any top-level 'inclusions' from 'exclusions'. Returns a vector of two queries inclusions and the exclusions. Exclusions will be rewritten from MUST_NOT to MUST. Useful in a situation where exclusions need to be applied independently to a substrate and the NOT will be specified in a parent clause.
(search-all searcher q)
Search a lucene index and return all results matching query specified. Results are returned as a sequence of Lucene document ids.
Search a lucene index and return *all* results matching query specified. Results are returned as a sequence of Lucene document ids.
(tokenize analyzer field-name s)
Tokenize the string 's' according the 'analyzer' and field specified.
Tokenize the string 's' according the 'analyzer' and field specified.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close