A computer implemented method carried out by one or more servers, the method comprising: receiving a search query; determining whether to rewrite the received search query, by: determining whether an entity name of the search query is included in a table that includes a plurality of entity names and corresponding entity identifiers, wherein entity names included in the table comprise candidate strings, the candidate strings based on variations of an entity name; a given entity name and corresponding entity identifier being included in the table when a total number of selections of the corresponding entity identifier associated with a search result, exceeds a threshold and is greater than a total number of selections, of other entity identifiers associated with other search results, the search result and the other search results being associated with prior searches conducted based on prior search queries that include the given entity name; and if it is determined that the received search query is to be rewritten; rewriting, using the table, the received search query into a rewritten search query that includes the entity identifier associated with the received entity name as a restrict identifier, the restrict identifier configured to restrict the search to the entity identifier associated with the received entity name, automatically performing the search restricted to the entity identifier associated with the received entity name using the rewritten search query to obtain search results; and presenting the obtained search results. receiving a search query; determining whether to rewrite the received search query, by: determining whether an entity name of the search query is included in a table that includes a plurality of entity names and corresponding entity identifiers, wherein entity names included in the table comprise candidate strings, the candidate strings based on variations of an entity name; a given entity name and corresponding entity identifier being included in the table when a total number of selections of the corresponding entity identifier associated with a search result, exceeds a threshold and is greater than a total number of selections, of other entity identifiers associated with other search results, the search result and the other search results being associated with prior searches conducted based on prior search queries that include the given entity name; and if it is determined that the received search query is to be rewritten; rewriting, using the table, the received search query into a rewritten search query that includes the entity identifier associated with the received entity name as a restrict identifier, the restrict identifier configured to restrict the search to the entity identifier associated with the received entity name, automatically performing the search restricted to the entity identifier associated with the received entity name using the rewritten search query to obtain search results; and presenting the obtained search results. determining whether an entity name of the search query is included in a table that includes a plurality of entity names and corresponding entity identifiers, wherein entity names included in the table comprise candidate strings, the candidate strings based on variations of an entity name; a given entity name and corresponding entity identifier being included in the table when a total number of selections of the corresponding entity identifier associated with a search result, exceeds a threshold and is greater than a total number of selections, of other entity identifiers associated with other search results, the search result and the other search results being associated with prior searches conducted based on prior search queries that include the given entity name; and if it is determined that the received search query is to be rewritten; rewriting, using the table, the received search query into a rewritten search query that includes the entity identifier associated with the received entity name as a restrict identifier, the restrict identifier configured to restrict the search to the entity identifier associated with the received entity name, automatically performing the search restricted to the entity identifier associated with the received entity name using the rewritten search query to obtain search results; and presenting the obtained search results.