使用 android 应用索引删除索引数据(不要在 Google 搜索结果中显示索引数据)



我能够通过使用"AppIndex.AppIndexApi.start(mGoogleApiClient, indexAction);"在默认的谷歌搜索结果上显示索引内容(自动完成);

但在那之后,我决定从谷歌搜索结果中删除一些索引内容(自动完成)。

例如: 在应用程序的第一个版本中,索引在内容下方。 1. 虚拟内容(安卓 app://com.myindexingapp/sample/Dummy 内容) 2. 虚拟内容2(安卓 app://com.myindexingapp/sample/Dummy 内容2)

我可以在设备上的谷歌搜索结果中看到虚拟内容和虚拟内容2。

在第二个版本中,我只想显示虚拟内容 表示我想取消索引虚拟内容2(安卓 app://com.myindexingapp/sample/Dummy 内容2)

谁能帮我如何实现这一目标?

我尝试使用"AppIndex.AppIndexApi.end(mGoogleApiClient, indexAction);" 用同样的动作,但它不起作用。

在这里,我使用"GoogleApiClient"和"AppIndex.AppIndexApi"来索引数据(在第一个版本中没有使用最新的Firebase索引)。

使用以下代码修复了此问题。

com.google.firebase.appindexing.Action fbIndexAction = Actions.newView(title, BASE_APP_URI.toString());
Log.v(LOG_TAG, "@@@@ data path here " + title + " uri here " + BASE_APP_URI);
FirebaseUserActions.getInstance().end(fbIndexAction);
FirebaseAppIndex.getInstance().remove(BASE_APP_URI.toString());

最新更新