In addition to the traditional keyword search, FiscalNote offers advanced options, including boolean modifiers, that can help you form more specific queries to find more relevant results.
All of these operators work equally well in Discovery Alert queries as well, which behave the same way as searches on the FiscalNote Search pages.
Quotes indicate that the results should include the exact words in the exact order. Capitalization and punctuation are ignored, unless the punctuation is a special symbol. If words such as “and” or “or” are included within double quotes, they are treated as normal search terms. You can use double quotes in addition to other operators.
Note: In general, do not use single quotes at all (‘’) because they do not work the way you might expect. For English queries they are ignored entirely, but when translated to other languages, they cause syntax problems because any boolean operator inside single quotes will be translated (thus giving a potentially invalid query that is different from the English version).
Examples:
- “sales tax” == “Sales TAX”
- “auto insurance” OR “car insurance”
- “natural gas leak” == “natural gas leaks”
As in most search engines, this operator is the default in our search. When searching two or more terms, you can separate those terms with the upper-case word AND. However, the AND is implicit, and the search function assumes that there is an AND between them. You can think of this as as an intersection, with each additional term restricting the set of results further. An AND inserted inside quotes will not act as a boolean operator, but rather as the word “and”.
Examples:
- health insurance (the AND is implied)
- property tax == property AND tax ≠≠ “property tax”
- infrastructure AND bridge
- “renewable energy” AND “solar panels”
The OR operator yields results with at least one of the terms, therefore, broadening the search results. All documents with at least one matching term are returned.
Examples:
- “sales tax” OR “value added tax”
- fracking OR fracturing
- petroleum OR oil OR fuel
The search result will exclude a particular term immediately after the operator NOT. The (-) and (!) operators can be used to indicate NOT. The NOT operator is a very powerful term because it will exclude any document that matches the term after NOT. It should only be used carefully. In many cases it may cause more harm (missing relevant content) than it helps.
Gotcha: If you intend for your NOT terms to apply for the entire search query, you must be careful that it logically applies to all other matching query terms. See the section below about “Parentheses” as well. This means there needs to be parentheses that group together all of the terms that you do want to match. e.g. (a OR b OR c OR d) NOT (x OR y OR z). This is equivalent to (a OR b OR c OR d) NOT x NOT y NOT z, but the former with parentheses that also group the NOT terms together is perhaps easier to read and less error-prone than the latter. As with query terms, (a) NOT x NOT y is equivalent to (a) AND NOT x AND NOT y.
If you omit the parentheses around the matching terms (e.g. for bad query a OR b OR c OR d NOT (x OR y OR z)), all of the NOT clauses will only apply to the term right before it (e.g. d NOT (x OR y OR z)). Therefore, in this case you would also still see matches for a OR b OR c that are not affected by the NOT clauses, which is probably not what you want.
- energy NOT electricity
- insurance NOT “life insurance”
- pet NOT cat NOT dog == pet -cat -dog
- (pet OR wildlife) NOT (cat OR dog)
Parentheses are best utilized for complex searches to combine terms and other operators. They are used to override the precedence of application of the boolean operators, similar to the distributive property in multiplication. Think of PEMDAS! The order of precedence for boolean operators is:
- Parentheses
- Quotes
- Proximity
- AND, NOT (both are equivalent in priority)
- OR
This order may be difficult to remember, which is why using parentheses is recommended for clarity in any case where more than one type of boolean operator (AND, NOT, OR) are combined together to make a single search clause. Note that any mentions of “term” in the explanations for AND, OR, or NOT equally applies to clauses that are more complex than just a single word or phrase. These clauses may include more parentheses within them. Note however, that an overly complex search query will become difficult for a human to read, understand, and edit without making mistakes.
Examples:
- (health insurance) == health insurance
- (health OR life) AND insurance == (health OR life) insurance
- banking OR (financial regulation) ≠≠ (banking OR financial) regulation
- ((health OR life) AND insurance) OR ((medical OR doctor) AND malpractice)
The proximity operator (~#) can be used to find sets of words within a specified proximity to or distance from one another. It can only be applied directly to a quoted phrase (with more than one word). Ensure there is no space between the closing quotation mark and the tilde. It can match if the words appear within the specified distance.
The words can appear in a different order from the quoted phrase. As a rule of thumb, distance is affected by: each additional word in the middle adds 1 distance, and each word from the phrase that appears out of order counts as 1 additional distance.
As with other Quoted phrase searches, you cannot use OR or NOT within a proximity phrase, but you can combine multiple proximity phrases with these and other boolean operators.
Best Practices:
- ~5 -~10: Utilize small proximities for terms with limited variations.
- ~10 -~15: Utilize large proximities for broad searches that may span a paragraph or several sentences.
- FiscalNote does not support proximity searching greater than ~20.
Examples:
-
“health insurance”~5
- Returns texts with the words “health” and “insurance” within 5 words of each other
- “health insurance”~5 OR “medical insurance”~5
- (“health insurance”~5 OR “medical insurance”~5) AND “malpractice harm”~10
-
For this example: (“health insurance”~5 OR “medical insurance”~5) NOT paperwork
- Note: the NOT paperwork checks the entire document, not just the snippets that might have matched the proximity phrases.
Comments
0 comments
Article is closed for comments.