Search similar questions
GET /search/questions-similar
Deprecation warning: the endpoints GET /search/questions
and GET /search/questions/similar
should no longer be used. When migrating to the new GET /search/questions-similar
endpoint, note that the question objects, which previously were the elements of the items
list in the response, are now one level deeper in the JSON structure.
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
query |
string |
- | ✓ | A search query for questions |
limit |
int |
10 | ✗ | The maximal number of questions to be returned. |
This request will search for similar questions. This is different from a full-text search as this request searches for questions about topics closely related to the content of the given query, not necessary questions where the given query occurs word for word. As such, the similar question search works best for longer queries, such as one or more full sentences. For keyword searches, the query
parameter on the GET /questions
endpoint should be used instead.
Each item in the response contains a score, which is the cosine similarity from the RRI algorithm used for the similar question search. As such, it is a floating point value between -1 and 1, with higher values corresponding to greater similarity.
Consult the Concepts section for more technical details about search.
{
"total": 1,
"items": [
{
"question": {
"solutions": "/questions/21/solutions",
"description": "<p>Information can be delivered to any Baker Street Irregular.</p>",
"solution_count": 1,
"view_count": 28,
"tags": "/questions/21/tags",
"slug": "what-is-the-question",
"id": 5917,
"updated": "2013-09-20T18:48:35.000Z",
"language": "de",
"title": "What is the question?",
"attachments": "/questions/21/attachments",
"is_published": true,
"created": "2012-01-24T12:54:18.000Z",
"comments": "/questions/21/comments"
},
"score": 0.6097216010093689
}
]
}