Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

What does the migrated parameter to the advanced_search method mean? Setting it to true on CS finds only one question that has been migrated away, out of several:

{
  "items": [
    {
      "question_id": 2522,
      "creation_date": 1340853778,
      "last_activity_date": 1340854916,
      "locked_date": 1340859540,
      "score": 0,
      "answer_count": 0,
      "migrated_to": {
        "question_id": 11238316,
        "other_site": {
          "site_type": "main_site",
          "name": "Stack Overflow",
          …
        },
        "on_date": 1340859540
      },
      "closed_date": 1340859536,
      "title": "Java Question about Setting a Word as a Variable",
      "tags": [
        "java"
      ],
      "closed_reason": "off topic",
      "view_count": 15,
      "owner": {
        "user_id": 1993,
        "display_name": "Andy",
        "reputation": 1,
        "user_type": "unregistered",
        "profile_image": "http://www.gravatar.com/avatar/3bb5d5e41932ae3040ec4db74d795694?d=identicon&r=PG",
        "link": "http://cs.stackexchange.com/users/1993/andy"
      },
      "link": "http://cs.stackexchange.com/questions/2522/java-question-about-setting-a-word-as-a-variable",
      "is_answered": false
    }
  ],
  "quota_remaining": 9949,
  "quota_max": 10000,
  "has_more": false
}

Setting it to false doesn't eliminate all questions that are migrated away nor all questions that were migrated in. From https://api.stackexchange.com/2.1/search/advanced?order=desc&sort=creation&closed=True&migrated=False&site=cs (excerpted):

{
  "question_id": 2852,
  "migrated_to": {
    "question_id": 2546,
    "other_site": {
      "site_type": "main_site",
      "name": "Academia",
    },
    "on_date": 1342899193
  },
  "closed_date": 1342899193,
  "link": "http://cs.stackexchange.com/questions/2852/what-are-some-proven-methods-for-keeping-track-of-research-and-programming-in-a",
  "is_answered": false
},

{
  "question_id": 2573,
  "migrated_from": {
    "question_id": 164947,
    "other_site": {
      "site_type": "main_site",
      "name": "Mathematics",
    },
    "on_date": 1341174776
  },
  "closed_date": 1341826160,
  "link": "http://cs.stackexchange.com/questions/2573/proof-of-np-completeness-of-graph-isomorphism-through-edge-contractions-that-red",
  "is_answered": false
},
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

migrated is equivalent to searching with migrated:1 or migrated:0 on the site itself.

In other words, migrated=true returns questions that have migrated_to (questions that have been migrated away from the site they were originally asked on). migrated=false returns questions that don't have migrated_to, but may have migrated_from.

There was a bug (fixed in the latest deploy) around questions that had been recently migrated muddling the data. Remember, there's always also the possibility of the search index being a little behind.

share|improve this answer
    
Maybe this should be on MSO then. Why is this question (migrated away from the site 4 days ago, not deleted) not returned in migrated:1? –  Gilles Jul 25 '12 at 19:19
    
@Gilles I believe that will be fixed in the next build + a re-index. API search indexes are a bit in flux at the moment... –  Kevin Montrose Jul 25 '12 at 19:23
    
@Gilles - we've built and indexes are finished updating, everything should be good now. –  Kevin Montrose Jul 25 '12 at 21:08
add comment

You must log in to answer this question.

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