- Graphwise Platform Documentation
- Graphwise API Endpoints
- GraphSearch API
- Search Services
- Using Relevance Scoring to Improve Search Results Ordering
Using Relevance Scoring to Improve Search Results Ordering
02/02/2026
In a search request, we use a SearchFilter's value field to specify concepts from our taxonomy to search for and the boosting field to indicate how much to boost a search result with that value.
Setting the useRelevanceScoring field to true can improve the ordering of the search results by giving a higher priority to documents that are more important for the given taxonomy concepts. With this on, if the search finds a document that has a set of the values that were specified in the request (or, according to a taxonomy, related values such as plural forms, alternative labels, and other values identified by the Entity Extractor APIs), a score is calculated using the base score from Elasticsearch multiplied by each value's boosting factor. Then, to calculate the document's score for ordering of search results, all the scores are added together for that document for each value that was present in both the document and the request.
To see this effect on search results, note the score value in the search results after adjusting any of these parameters.
Note
useRelevanceScore is set to false by default because with large requests it can slow down searches.
For this example we have a searchspace that is connected to the Cocktails taxonomy and we have documents with descriptions of cocktails. We'll look at an example search that has useRelevanceScoring set to false and then look at the effect of setting it to true.
We'll start with this request, which searches for documents about cocktails related to the taxonomy concept that has the URI "http://vocabulary.semantic-web.at/cocktails/33df103a-03ac-4177-b620-7953fe094236".
{
"searchSpaceId": "b1708b2b-ef02-4204-bb88-9edda2010b4e",
"searchFilters": [
{
"field" : "dyn_uri_all_concepts",
"value" : "http://vocabulary.semantic-web.at/cocktails/33df103a-03ac-4177-b620-7953fe094236"
}
],
"useRelevanceScoring" : false,
"format": "json",
"locale": "en",
"count": 10,
"start": 0
}Instead of searching with a concept URI, you could also do a full-text search by setting field to "full_text_search" and value to the search string. The example below is the same as the one above except that field is set to "full_text_search" and the search string is "Lemon". The URI "http://vocabulary.semantic-web.at/cocktails/33df103a-03ac-4177-b620-7953fe094236" in the first query identifies the concept of "Lemon", so these two queries will have the same effect.
{
"searchSpaceId": "b1708b2b-ef02-4204-bb88-9edda2010b4e",
"searchFilters": [
{
"field" : "full_text_search",
"value" : "Lemon"
}
],
"useRelevanceScoring" : false,
"format": "json",
"locale": "en",
"count": 10,
"start": 0
}Both of the queries shown above give us this result:
{
"success": true,
"status": 200,
"message": "query time: 1 ms",
"resultType": "application/vnd.semantic-web.graphsearch.searchresult-v2+json",
"result": [
{
"searchSpaceId": "b1708b2b-ef02-4204-bb88-9edda2010b4e",
"id": "https://semantic-web.com/sidecar",
"title": "Sidecar",
"description": "The sidecar is a cocktail traditionally made with brandy (usually cognac), orange liqueur (Cointreau, Grand Marnier, dry curaçao, or a triple sec), and lemon juice. It became popular in Paris and London in the early 1920s. Common modifications of the original recipe are a sugar rim, added sugar syrup, and an orange twist or lemon twist. Similar drinks The sidecar is categorized as a daisy: a spirit, citrus juice, and a liqueur as sweetener. Other well-known daisies include the margarita (literally daisy in Spanish) and the White Lady. Daisies are variants of the older sour formula, which use sugar for sweetening; daisies are more complex and often drier. Daisies in general and the sidecar in particular are considered more of a challenge for bartenders because the proportion of ingredients is more difficult to balance for liqueurs of variable sweetness.[1] In its ingredients, the drink is perhaps most closely related to the older brandy crusta, which differs both in presentation and in proportions of its components.",
"link": "https://semantic-web.com/sidecar",
"type": "User",
"facetList": [],
"score": 1.3333945,
"empty": false
},
{
"searchSpaceId": "b1708b2b-ef02-4204-bb88-9edda2010b4e",
"id": "https://semantic-web.com/paradise",
"title": "Paradise",
"description": "The Paradise is an IBA official cocktail, and is classified as a pre-dinner drink, an apéritif. The earliest known in-print recipe for the Paradise Cocktail was written by Harry MacElhone in 1922.[1] The canonical version is associated with Harry Craddock in 1930. This cocktail is prepared using gin, apricot brandy, and orange juice in a 2:1:1 ratio, with a splash of lemon juice.[2] In popular culture The Paradise cocktail plays a key part in the 1932 Warner Bros. romantic film One Way Passage as the drink of the two star-crossed lovers played by Kay Francis and William Powell.[3] The Paradise cocktail was popularized by rapper Snoop Dogg in the track \"Gin and Juice\" on his debut album Doggystyle.[4] On May 27, 2018, Snoop Dogg, Warren G and Michael Voltaggio set the world record for the largest Gin and Juice, a 500-litre (132 gallon) paradise cocktail that contained 180 bottles of gin, 154 bottles of apricot brandy, and 144 liters (38 gallons) of orange juice. ",
"link": "https://semantic-web.com/paradise",
"type": "User",
"facetList": [],
"score": 1.0285219,
"empty": false
},
{
"searchSpaceId": "b1708b2b-ef02-4204-bb88-9edda2010b4e",
"id": "https://semantic-web.com/negroni",
"title": "Negroni",
"description": "A negroni is an Italian cocktail, made of equal parts gin, vermouth rosso (red, semi-sweet), and Campari, generally served with ice, and commonly garnished with an orange slice or orange peel.[1] It is considered an apéritif. The drink has been documented in Italy since the late 1940s, and became popular in the 1950s, but the origin is uncertain, and early recipes differ somewhat from the modern standard; early recipes were either these three ingredients served straight up (in a cocktail glass or coupe, no ice), or were served long (over ice with soda). The modern recipe of equal parts served short (over ice, without soda) is not recorded until the 1950s or 1960s. The basic recipe – an equal-parts cocktail of these three ingredients – is first recorded in French cocktail books of the late 1920s, alongside many similar drinks; in Italy a long drink of equal parts vermouth and Campari (but no gin), topped with soda and served over ice, has existed since the 1800s under the names Milano–Torino or Americano. There are claims of Italian drinks by the name Negroni containing gin from 1919, though these differ significantly from the modern drink. Technique Negronis are often garnished with an orange peel. The International Bartenders Association recipe for the negroni specifies that it be built over ice in an old-fashioned or rocks glass and garnished with a slice of orange, similar to an old fashioned or spritz (short, minus the soda). Common variations include using an orange peel (or lemon peel) in place of an orange slice (especially outside Italy),[2] stirring then pouring over ice, and sometimes stirring and serving straight up. ... ",
"link": "https://semantic-web.com/negroni",
"type": "User",
"facetList": [],
"score": 0.87268066,
"empty": false
},
{
"searchSpaceId": "b1708b2b-ef02-4204-bb88-9edda2010b4e",
"id": "https://semantic-web.com/daiquiri",
"title": "Daiquiri",
"description": "The daiquiri (/ˈdaɪkəri, ˈdæk-/; Spanish: daiquirí [dajkiˈɾi]) is a cocktail whose main ingredients are rum, citrus juice (typically lime juice), and sugar or other sweetener. The daiquiri is one of the six basic drinks listed in David A. Embury's classic The Fine Art of Mixing Drinks, which also lists some variations. Origins Daiquirí is also the name of a beach and an iron mine near Santiago de Cuba in eastern Cuba, and is a word of Taíno origin.[1] Historians widely agree that the cocktail was invented by an American mining engineer named Jennings Cox, who was in Cuba (then at the tail-end of the Spanish Captaincy-General government) at the time of the Spanish–American War of 1898. It is also possible that William A. Chanler, a US congressman who purchased the Santiago iron mines in 1902, introduced the daiquiri to clubs in New York in that year.[2]: 168 [3] Originally the drink was served in a tall glass packed with cracked ice. A teaspoon of sugar was poured over the ice, and the juice of one or two limes was squeezed over the sugar. Two or three ounces of white rum completed the mixture. The glass was then frosted with a long-handled spoon. Later the daiquiri evolved to be mixed in a shaker with the same ingredients but with shaved ice. After a thorough shaking, it was poured into a chilled coupe glass. The Daiquiri was subsequently refined and popularized by Emelio \"Maragato\" Gonzalez and Constantino \"Constante\" Ribalaigua Vert in Havana.[4] The basic recipe for a daiquiri is also similar to the grog British sailors drank aboard ships from the 1780s. By 1795 the Royal Navy daily grog ration contained rum, water, ¾ ounce of lemon or lime juice, and 2 ounces of sugar.[5] This was a common drink across the Caribbean, and as soon as ice became available this was included instead of the water. Consumption of the drink remained localized until 1909, when Rear Admiral Lucius W. Johnson, a U.S. Navy medical officer, tried Cox's drink. Johnson subsequently introduced it to the Army and Navy Club in Washington, D.C., and drinkers of the daiquiri increased over the space of a few decades. It was one of the favorite drinks of the writer Ernest Hemingway and U.S. President John F. Kennedy.[6] The drink became popular in the 1940s. World War II rationing made whiskey and vodka hard to come by, yet rum was easily obtainable owing to U.S. President Franklin D. Roosevelt's Good Neighbor policy, which opened up trade and travel relations with Latin America, Cuba, and the Caribbean. The Good Neighbor policy, also known as the Pan-American program, helped make Latin America fashionable.[according to whom?] Consequently, rum-based drinks (once frowned upon as the choice of sailors and down-and-outs) also became fashionable, and the daiquiri saw tremendous popularity in the US.",
"link": "https://semantic-web.com/daiquiri",
"type": "User",
"facetList": [],
"score": 0.6953258,
"empty": false
}
],
"request": {
...
"useRelevanceScoring": false
},
"total": 4,
"facetList": []
}Doing the same request with useRelevanceScoring set to true gives us this result:
{
"success": true,
"status": 200,
"message": "query time: 1 ms",
"resultType": "application/vnd.semantic-web.graphsearch.searchresult-v2+json",
"result": [
{
"searchSpaceId": "b1708b2b-ef02-4204-bb88-9edda2010b4e",
"id": "https://semantic-web.com/sidecar",
"title": "Sidecar",
"description": "The sidecar is a cocktail traditionally made with brandy (usually cognac), orange liqueur (Cointreau, Grand Marnier, dry curaçao, or a triple sec), and lemon juice. It became popular in Paris and London in the early 1920s. Common modifications of the original recipe are a sugar rim, added sugar syrup, and an orange twist or lemon twist. Similar drinks The sidecar is categorized as a daisy: a spirit, citrus juice, and a liqueur as sweetener. Other well-known daisies include the margarita (literally daisy in Spanish) and the White Lady. Daisies are variants of the older sour formula, which use sugar for sweetening; daisies are more complex and often drier. Daisies in general and the sidecar in particular are considered more of a challenge for bartenders because the proportion of ingredients is more difficult to balance for liqueurs of variable sweetness.[1] In its ingredients, the drink is perhaps most closely related to the older brandy crusta, which differs both in presentation and in proportions of its components. ",
"link": "https://semantic-web.com/sidecar",
"type": "User",
"facetList": [],
"score": 6.045944,
"empty": false
},
{
"searchSpaceId": "b1708b2b-ef02-4204-bb88-9edda2010b4e",
"id": "https://semantic-web.com/daiquiri",
"title": "Daiquiri",
"description": "The daiquiri (/ˈdaɪkəri, ˈdæk-/; Spanish: daiquirí [dajkiˈɾi]) is a cocktail whose main ingredients are rum, citrus juice (typically lime juice), and sugar or other sweetener. The daiquiri is one of the six basic drinks listed in David A. Embury's classic The Fine Art of Mixing Drinks, which also lists some variations. Origins Daiquirí is also the name of a beach and an iron mine near Santiago de Cuba in eastern Cuba, and is a word of Taíno origin.[1] Historians widely agree that the cocktail was invented by an American mining engineer named Jennings Cox, who was in Cuba (then at the tail-end of the Spanish Captaincy-General government) at the time of the Spanish–American War of 1898. It is also possible that William A. Chanler, a US congressman who purchased the Santiago iron mines in 1902, introduced the daiquiri to clubs in New York in that year.[2]: 168 [3] Originally the drink was served in a tall glass packed with cracked ice. A teaspoon of sugar was poured over the ice, and the juice of one or two limes was squeezed over the sugar. Two or three ounces of white rum completed the mixture. The glass was then frosted with a long-handled spoon. Later the daiquiri evolved to be mixed in a shaker with the same ingredients but with shaved ice. After a thorough shaking, it was poured into a chilled coupe glass. The Daiquiri was subsequently refined and popularized by Emelio \"Maragato\" Gonzalez and Constantino \"Constante\" Ribalaigua Vert in Havana.[4] The basic recipe for a daiquiri is also similar to the grog British sailors drank aboard ships from the 1780s. By 1795 the Royal Navy daily grog ration contained rum, water, ¾ ounce of lemon or lime juice, and 2 ounces of sugar.[5] This was a common drink across the Caribbean, and as soon as ice became available this was included instead of the water. Consumption of the drink remained localized until 1909, when Rear Admiral Lucius W. Johnson, a U.S. Navy medical officer, tried Cox's drink. Johnson subsequently introduced it to the Army and Navy Club in Washington, D.C., and drinkers of the daiquiri increased over the space of a few decades. It was one of the favorite drinks of the writer Ernest Hemingway and U.S. President John F. Kennedy.[6] The drink became popular in the 1940s. World War II rationing made whiskey and vodka hard to come by, yet rum was easily obtainable owing to U.S. President Franklin D. Roosevelt's Good Neighbor policy, which opened up trade and travel relations with Latin America, Cuba, and the Caribbean. The Good Neighbor policy, also known as the Pan-American program, helped make Latin America fashionable.[according to whom?] Consequently, rum-based drinks (once frowned upon as the choice of sailors and down-and-outs) also became fashionable, and the daiquiri saw tremendous popularity in the US....",
"link": "https://semantic-web.com/daiquiri",
"type": "User",
"facetList": [],
"score": 5.247875,
"empty": false
},
{
"searchSpaceId": "b1708b2b-ef02-4204-bb88-9edda2010b4e",
"id": "https://semantic-web.com/paradise",
"title": "Paradise",
"description": "The Paradise is an IBA official cocktail, and is classified as a pre-dinner drink, an apéritif. The earliest known in-print recipe for the Paradise Cocktail was written by Harry MacElhone in 1922.[1] The canonical version is associated with Harry Craddock in 1930. This cocktail is prepared using gin, apricot brandy, and orange juice in a 2:1:1 ratio, with a splash of lemon juice.[2] In popular culture The Paradise cocktail plays a key part in the 1932 Warner Bros. romantic film One Way Passage as the drink of the two star-crossed lovers played by Kay Francis and William Powell.[3] The Paradise cocktail was popularized by rapper Snoop Dogg in the track \"Gin and Juice\" on his debut album Doggystyle.[4] On May 27, 2018, Snoop Dogg, Warren G and Michael Voltaggio set the world record for the largest Gin and Juice, a 500-litre (132 gallon) paradise cocktail that contained 180 bottles of gin, 154 bottles of apricot brandy, and 144 liters (38 gallons) of orange juice. ...",
"link": "https://semantic-web.com/paradise",
"type": "User",
"facetList": [],
"score": 1.0285219,
"empty": false
},
{
"searchSpaceId": "b1708b2b-ef02-4204-bb88-9edda2010b4e",
"id": "https://semantic-web.com/negroni",
"title": "Negroni",
"description": "A negroni is an Italian cocktail, made of equal parts gin, vermouth rosso (red, semi-sweet), and Campari, generally served with ice, and commonly garnished with an orange slice or orange peel.[1] It is considered an apéritif. The drink has been documented in Italy since the late 1940s, and became popular in the 1950s, but the origin is uncertain, and early recipes differ somewhat from the modern standard; early recipes were either these three ingredients served straight up (in a cocktail glass or coupe, no ice), or were served long (over ice with soda). The modern recipe of equal parts served short (over ice, without soda) is not recorded until the 1950s or 1960s. The basic recipe – an equal-parts cocktail of these three ingredients – is first recorded in French cocktail books of the late 1920s, alongside many similar drinks; in Italy a long drink of equal parts vermouth and Campari (but no gin), topped with soda and served over ice, has existed since the 1800s under the names Milano–Torino or Americano. There are claims of Italian drinks by the name Negroni containing gin from 1919, though these differ significantly from the modern drink. Technique Negronis are often garnished with an orange peel. The International Bartenders Association recipe for the negroni specifies that it be built over ice in an old-fashioned or rocks glass and garnished with a slice of orange, similar to an old fashioned or spritz (short, minus the soda). Common variations include using an orange peel (or lemon peel) in place of an orange slice (especially outside Italy),[2] stirring then pouring over ice, and sometimes stirring and serving straight up. ...",
"type": "User",
"facetList": [],
"score": 0.87268066,
"empty": false
}
],
"request": {
"encoding": "UTF-8",
"locale": "en",
"start": 0,
"count": 10,
"searchSpaceId": "b1708b2b-ef02-4204-bb88-9edda2010b4e",
"searchFilters": [
{
...
"useRelevanceScoring": true
},
"total": 4,
"facetList": []
}
The new results show that the documents with the titles "Sidecar" and "Daiquiri" got a considerable boost to their score values when useRelevanceScoring was set to true . This was because the “Lemon” concept in the taxonomy was found in the "Sidecar" and "Daiquiri" documents with a specific extraction score. That extraction score was then used to boost the relevance score of those documents, moving the more relevant results earlier in the list.
Note that while "lemon peel" was mentioned in the Negroni document, this is a separate concept from "Lemon" in the taxonomy, so the Negroni document did not get the boost that the Sidecar and Daiquiri documents got.