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. 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.
Consult Solr documentation for even more extensive ways to construct search queries.
Fielded Search
Search based on specific metadata fields for documents. Note that field names are lower case.
title:initiation
Searches for the word “initiation” in the title of the document.title:initiation !male
Searches for the word “initiation” in the title where the word “male” is NOT present.author:Whiting
Searches for the primary author Whiting.author:Whiting NOT Beatrice
Searches for the author Whiting, but not Beatrice.
Phrase Searches
"environmental unpredictability"
Searches have to match the phrase environmental unpredictability.hypothesis:"environmental unpredictability"
Searches have to match the phrase environmental unpredictability in the hypothesis field.
Wildcards
Hunt*
Searches for all words that start with hunt such as hunting, hunter, etc.Game?
Searches for all words that have any one character after the word. Would match Game, Games, or Gamey
Proximity matching
"unilocal unilineal"~5
Finds occurrences where unilocal and unilineal appear within five words of each other."division labor"~3
Finds occurrences where division and labor are within 3 words of each other.
Fuzzy searching
Monroe~
Searches for words based on the Levenshtein distance. Therefore, this search might find Munroe, the correct spelling, as it is of similar spelling.culture~.2
Specifies a required similarity between 0 and 1. The default is .5.
Boosting a search term
Note: boosting works best when sorting by Relevance
Matrilineal^5 kinship
This search boosts the relevance of the word matrilineal.author:"Bacon, Margaret K."^2 OR additional_authors:"Bacon, Margaret K."
This search looks in the author field and additional authors field. However, the results prefer Barry III, Herbert as the primary author.
Searching for HRAF’s subject terms (OCMs)
ocm:342
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.ocm_terms:"puberty and initiation"
Searches for the Outline of Cultural Materials term Puberty and Initiation. Note this is surrounded in quotes to match a phrase.
Range search
Caution
TO must be upper case.
pub_year:[2005 TO 2010]
Searches studies published from 2005 to 2010
Boolean searches
Caution
AND, OR, and NOT must be uppercase.
ocms:342 OR dwelling*
Searches for the OCM 342 or the word dwelling or dwellings.("division labor"~3) AND residence
Combines proximity match search with the word search for residence.