Search Syntax

Searching in eHRAF is built with Apache Solr. This page covers several example search queries you can use with regular searches for paragraphs or searches on the browse documents page. Note that Advanced Searches perform some of this functionality using an interface, and it isn’t possible to use this syntax in an Advanced Search form.

Phrase Searches

  1. "land use" (Demo): Searches have to match the phrase “land use”.

  2. title:"land use" (Demo): Searches have to match the phrase “land use” in the title field.

Wildcards

  1. Hunt* (Demo): Searches for all words that start with hunt such as hunting, hunter, etc.

  2. text:game? (Demo): Searches for all words that have any one character after the word. Would match Game, Games, or Gamey

Proximity matching

  1. text:"unilocal unilineal"~5 (Demo): Finds occurrences where unilocal and unilineal appear within five words of each other.

  2. text:"division labor"~3 (Demo): Finds occurrences where division and labor are within 3 words of each other.

Fuzzy searching

  1. Monroe~ (Demo): Searches for words based on the Levenshtein distance. Therefore, this search might find Munroe, the correct spelling, as it is of similar spelling.

  2. culture~.2 (Demo): Specifies a required similarity between 0 and 1. The default is .5.

Boosting a search term

Note: boosting works best when sorting by Relevance

  1. Matrilineal^5 kinship (Demo): This search boosts the relevance of the word matrilineal.

  2. author:"author:"MacNeish, Richard S."^2 OR authors:"MacNeish, Richard S." (Demo): This search looks in the author field and additional authors field. However, the results prefer MacNeish, Richard S. as the primary author.

Searching for HRAF’s subject terms (OCMs)

  1. ocm_ids:"342" (Demo): This search looks for the subject category from the Outline of Cultural Materials “Dwellings” which has the identifier 342 as a shorthand. Variables are tagged with OCMs.

  2. subjects:"age stratification" (Demo): Searches for the Outline of Cultural Materials term “Age Stratification”. Note this is surrounded in quotes to match a phrase.

Boolean searches

Caution

AND, OR, and NOT must be uppercase.

  1. ocm_ids:"342" OR dwelling* (Demo): Searches for the OCM 342 or the word dwelling or dwellings.

  2. (text:"division labor"~3) AND residence (Demo): Combines proximity match search with the word search for residence.