Using Autocorrected Terms
When autocorrect is enabled, the autocorrected term for the search is generated. See the example below for the query “watr”. The autocorrected term “water” is generated.
Example Search Request with Autocorrected Terms
GET /edsapi/rest/Search?query=watr&searchmode=all&resultsperpage=20&pagenumber=1&sort=relevance&highlight=y&includefacets=y&view=brief&autosuggest=n&autocorrect=y
Example Search Response with Autocorrected Terms
<SearchResponseMessageGet xmlns="http://epnet.com/webservices/EbscoApi/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<SearchRequestGet>
<QueryString>query-1=AND,water&sort=relevance&includefacets=y&searchmode=all&autosuggest=n&autocorrect=n&view=brief&resultsperpage=20&pagenumber=1&highlight=y</QueryString>
<SearchCriteriaWithActions>
<QueriesWithAction>
<QueryWithAction>
<Query>
<BooleanOperator>AND</BooleanOperator>
<Term>water</Term>
</Query>
<RemoveAction>removequery(1)</RemoveAction>
</QueryWithAction>
</QueriesWithAction>
</SearchCriteriaWithActions>
</SearchRequestGet>
<SearchResult>
<Statistics>
<TotalHits>3570816</TotalHits>
<TotalSearchTime>2357</TotalSearchTime>
<Databases>
<Database>
<Id>cat01066a</Id>
<Label>Ebrary ebooks</Label>
<Status>0</Status>
<Hits>0</Hits>
</Database>
.
.
.
<AvailableFacet>
<Id>ContentProvider</Id>
<Label>Content Provider</Label>
<AvailableFacetValues>
<AvailableFacetValue>
<Value>MEDLINE</Value>
<Count>802115</Count>
<AddAction>addfacetfilter(ContentProvider:MEDLINE)</AddAction>
</AvailableFacetValue>
<AvailableFacetValue>
<Value>Business Source Complete</Value>
<Count>347994</Count>
<AddAction>addfacetfilter(ContentProvider:Business Source Complete)</AddAction>
</AvailableFacetValue>
<AvailableFacetValue>
<Value>JAMES MADISON UNIV's Catalog</Value>
<Count>22895</Count>
<AddAction>addfacetfilter(ContentProvider:JAMES MADISON UNIV's Catalog)</AddAction>
</AvailableFacetValue>
<AvailableFacetValue>
<Value>MIDDLE EAST TECHNICAL UNIVERSITY's Catalog</Value>
<Count>9581</Count>
<AddAction>addfacetfilter(ContentProvider:MIDDLE EAST TECHNICAL UNIVERSITY's Catalog)</AddAction>
</AvailableFacetValue>
</AvailableFacetValues>
</AvailableFacet>
</AvailableFacets>
<AvailableCriteria>
<DateRange>
<MinDate>1494-01</MinDate>
<MaxDate>2019-09</MaxDate>
</DateRange>
</AvailableCriteria>
<AutoSuggestedTerms>
<AutoSuggestedTerm>watr</AutoSuggestedTerm>
</AutoSuggestedTerms>
<AutoCorrectedTerms>
<AutoCorrectedTerm>water</AutoCorrectedTerm>
</AutoCorrectedTerms>
</SearchResult>
</SearchResponseMessageGet>
QueryString Response Tag
Please notice the element in the above response. The query-q query-string parameter is updated with the autocorrected search term and the autocorrect query-string parameter is set to “n”. The autocorrect query-string parameter is set to "n" because after the first search is executed, the term is already autocorrected and consecutive search hits do not need to be autocorrected.
<QueryString>query-1=AND,water&sort=relevance&includefacets=y&searchmode=all&autosuggest=n&autocorrect=n&view=brief&resultsperpage=20&pagenumber=1&highlight=y</QueryString>
Updated 6 months ago