You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the query exclude functionality, the user types - in front of the term they want to exclude. For example: -committee
Those excludes need to go into a separate query parameter called q_exclude. Regular query statements go into the query parameter q.
We have a python function called parse_query that will parse the exclude params for the more keyword options box, but need something similar for the AO JS API fetch calls.
In the Search keywords text box, type nevada -committee. This is doing a search for the word nevada and excluding the term committee. The query is sent without pushing committee into a separate query param q_exclude.
The text was updated successfully, but these errors were encountered:
Summary
When using the query exclude functionality, the user types
-
in front of the term they want to exclude. For example: -committeeThose excludes need to go into a separate query parameter called
q_exclude
. Regular query statements go into the query parameterq
.We have a python function called parse_query that will parse the exclude params for the more keyword options box, but need something similar for the AO JS API fetch calls.
Example correct API call:
https://api.open.fec.gov/v1/legal/search?ao_doc_category_id=F&type=advisory_opinions&hits_returned=20&from_hit=0&q=nevada&q_exclude=committee&api_key=DEMO_KEY
Example incorrect API call:
https://fec-dev-api.app.cloud.gov/v1/legal/search/?api_key=&type=advisory_opinions&ao_citation_require_all=false&ao_doc_category_id=F&sort=-ao_no&q=nevada+-committee
Frequency
We just recently noticed this bug with AO search filters after we made the template upgrades
Notes, steps, considerations
q_exclude
window.location like
?search_type=adrs&search=committee+-travel+-authorization
Fetch like
?type=adrs&hits_returned=20&from_hit=0&q=&q_exclude=travel+authorization
split on
+-
or%20-
(
+-(travel+authorization)
shouldn't be an issue)How to Reproduce
nevada -committee
. This is doing a search for the word nevada and excluding the term committee. The query is sent without pushingcommittee
into a separate query param q_exclude.The text was updated successfully, but these errors were encountered: