2

I'm curious if the search results from the API is calculated the same way as the searches from within the sites themselves?

Is there a difference between the two? If so, what are the differences?

1 Answer 1

0

The API only allows you to search in Questions. All four endpoints state that:

End point Description
Search Search the site for questions meeting certain criteria.
search advanced Search the site for questions using most of the on-site search options.
Similar Search the site based on similarity to a title.
Excerpts Searches a site

You might have high hopes that the Excerpts searches in all posts but its details reveals for some of its parameters:

q - a free form text parameter, will match all question properties based on an undocumented algorithm.
body - text which must appear in returned questions' bodies.

So that is also limited to only questions.

Beyond that there are the following site search options that are lacking from the API:

  • code
  • score
  • created
  • lastacive
  • inbookmarks
  • intags
  • hasaccepted
  • hascode
  • duplicate
  • locked
  • url
  • deleted

tl;dr: The API only searches in Questions where the site search takes both Questions and Answers into their scope. There only is a small subset of search options available in the API.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .