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

Expand search results to include, for example, all orthologs of all search results. #2

Open
mycrobe opened this issue Jan 15, 2016 · 1 comment

Comments

@mycrobe
Copy link
Contributor

mycrobe commented Jan 15, 2016

As a user I would like to be able to call a serach API enpoint and be returned all results and all orthologs of those results. The endpoint should have the same query parameter specification as /search but also require a parameter for the name of the field in the SOLR core with which to expand the search.

How the expand parameter would work:

  • It must contain either a gene Id or an array of gene Ids (and/or, perhaps, a space-separated string of multiple gene ids)
  • An initial search is performed using the paramters provided, as with the /search endpoint, except that only the id field is returned.
  • A second search is performed for any gene where the specified expand parameter contains any id in the result set from the first search.
  • If performant, results returned from the expand query should be modified to include the score from the initial query.
@ajo2995
Copy link
Member

ajo2995 commented Apr 4, 2016

I don't think this is needed within the swagger server. It is possible to expand a search through another field with facet counting.

First, add a facet field to the query params

{
    'facet.field' : '{!facet.limit=-1 facet.mincount=1}' + facetFieldName,
    facet: true
}

When the results come back, convert the values into a new filter
facetFieldName + ':(' + values.join(' OR ') + ')'
N.B. values has to be populated from the facet_counts.facet_fields[facetFieldName] array which alternates between field values and counts

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

No branches or pull requests

2 participants