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

Pass search filters into solr query to ensure displayable results are at the top of list. #1239

Closed
ddelpiano opened this issue Oct 26, 2021 · 5 comments · Fixed by #1241
Closed
Assignees

Comments

@ddelpiano
Copy link
Contributor

No description provided.

@ddelpiano
Copy link
Contributor Author

  • Append ‘bq’ with filters facets_annotation:X^100 (+) or facets_annotation:X^0.001 (-)

@ddelpiano
Copy link
Contributor Author

@jrmartin depending on the type of filter set (positive or negative filter) we will have to add these to the solr configuration in the bq parameter.
One possible approach is to retain the original 'bq' and augment this with the state of the filters once these changes.
Also we should it the search again when the filters change.

@jrmartin
Copy link
Contributor

jrmartin commented Nov 1, 2021

@ddelpiano @Robbie1977 Do we add the (+) and (-) as options to the filter set? Or how do we let the user choose between the (+) or (-)?

We can add them to the list of filters, and depending which one of them is selected, we assigned the value of "bq=" to it?
image

@Robbie1977
Copy link
Contributor

Robbie1977 commented Nov 3, 2021

@jrmartin I think the requirement has got a bit confusing.

NO changes to the filters tools/menu

all we need to do is take the selected filters and add them to the solr query parameters

so if we have:
image

Then we need to add these additional parameters to the solr query:
datasourceConfiguration['bq'] += " facets_annotation:DataSet^100 facets_annotation:Deprecated^0.001"

So ^100 moves the results score up and 0.001 down

The original parameters are:

var datasourceConfiguration = {
  "url": "https://solr.virtualflybrain.org/solr/ontology/select",
  "query_settings":
    {
      "q": "$SEARCH_TERM$ OR $SEARCH_TERM$* OR *$SEARCH_TERM$*",
      "defType": "edismax",
      "qf": "label^100 synonym^100 label_autosuggest_ws label_autosuggest_e label_autosuggest synonym_autosuggest_ws synonym_autosuggest shortform_autosuggest",
      "indent": "true",
      "fl": "short_form,label,synonym,id,facets_annotation",
      "start": "0",
      "pf":"true",
      "fq": [
        "shortform_autosuggest:VFB* OR shortform_autosuggest:FB* OR facets_annotation:DataSet OR facets_annotation:pub"
      ],
      "rows": "100",
      "wt": "json",
      "bq": "shortform_autosuggest:VFB*^110.0 shortform_autosuggest:FBbt*^100.0 label_s:\"\"^2 synonym_s:\"\" short_form:FBbt_00003982^2 facets_annotation:Deprecated^0.001"
    }
};

so after the change "bq" will be: "shortform_autosuggest:VFB*^110.0 shortform_autosuggest:FBbt*^100.0 label_s:\"\"^2 synonym_s:\"\" short_form:FBbt_00003982^2 facets_annotation:Deprecated^0.001 facets_annotation:DataSet^100 facets_annotation:Deprecated^0.001"

The parameter setup is here https://github.com/VirtualFlyBrain/geppetto-vfb/blob/master/components/configuration/VFBMain/searchConfiguration.js#L86

The actual name to use in the parameter vs name in the filter is from the key in https://github.com/VirtualFlyBrain/geppetto-vfb/blob/master/components/configuration/VFBMain/searchConfiguration.js#L182

@jrmartin
Copy link
Contributor

jrmartin commented Nov 3, 2021

Thanks @Robbie1977 , I understand now.

jrmartin added a commit that referenced this issue Nov 6, 2021
events and updates 'bq' property of query_results configuration for the
search. Use geppetto-client branch
https://github.com/openworm/geppetto-client/tree/VFBv2.2.0.7-feature/1238
@jrmartin jrmartin linked a pull request Nov 6, 2021 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants