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

Missing documentation for query options #192

Open
rjawesome opened this issue Jan 17, 2025 · 1 comment
Open

Missing documentation for query options #192

rjawesome opened this issue Jan 17, 2025 · 1 comment

Comments

@rjawesome
Copy link

In the documentation linked on https://mychem.info (https://docs.mychem.info/en/latest/index.html, https://docs.mychem.info/en/latest/doc/chem_query_service.html#query-parameters), there is missing documentation for some of the newer options such as jmespath.

@rjawesome
Copy link
Author

The docs seemed to be in this rst file, below I have put some docs for the missing query options that I found, this could be added in the GET/POST query options section of the rst file

explain
"""""""
    Optional, a boolean, which when true, returns the explanation of the scoring for each hit. Default: false. Example: "explain=true"

filter
""""""
    Optional, provides pre-filtering for the query results. The filter is applied before executing the main query and affects facet calculations. Uses the same query syntax as the main query parameter. Example: "filter=drugbank.weight.average:[200 TO 800]"

post_filter
""""""""""
    Optional, provides post-filtering for the query results. The filter is applied after executing the main query and does not affect facet calculations. Uses the same query syntax as the main query parameter. Example: "post_filter=chebi.mass:[100 TO 200]"

rawquery
""""""""
    Optional, when set to true, returns the raw Elasticsearch query structure used internally. Useful for debugging and understanding how queries are processed. Example: "rawquery=true"

jmespath
""""""""
    Optional, allows JMESPath expressions for transforming the results. Format is "field_path|expression". The field_path can be empty to apply to the root document. Examples:
    - "jmespath=chebi|[?mass > \`100\`]"
    - "jmespath=|{id: _id, name: chebi.name}"

always_list
""""""""""
    Optional, comma-separated list of fields that should always be returned as lists even if they contain a single value. Example: "always_list=chebi.xrefs,drugbank.categories"

jmespath_exclude_empty
"""""""""""""""""""""
    Optional, when set to true, removes documents where the JMESPath transformation yields empty results. Only applies when using the jmespath parameter. Example: "jmespath_exclude_empty=true"

allow_null
""""""""""
    Optional, comma-separated list of fields that will be null in the result if missing/null (by default null values are ommitted). Example: "allow_null=chebi.xrefs,drugbank.categories"

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

1 participant