2016-07-10 7 views
0

私はTitan 1.0.0とindexを使ってcassandraバックエンドとelasticsearchを使用しています。私は設定されたプロパティ(ユーザーID、電子メール、fullName ...など)を持つユーザーの頂点を持っています。これらのプロパティのいくつかは、elasticsearchで混合インデックスとして構成されます。今すぐ追加「年齢」プロパティマッピングから存在するプロパティを追加した後に、再インデックスのtitan 1.0.0混合インデックスが見つかりません

TitanManagement tm = graph.openManagement(); 
tm.addIndexKey(tm.getGraphIndex("users"), tm.getPropertyKey("age")); 
tm.commit(); 

されています。今、私が使用して混合インデックスに存在していた財産(前混合インデックスに含まれていなかったなど以前に設定プロパティ)を追加したいですelasticsearchに追加されました。ユーザ頂点の「年齢」プロパティの各更新は、「年齢」フィールドをelasticserch文書に追加します。しかし、タイタンクエリでこのインデックスを適切に使用するには、私は混合グラフインデックスを再インデックスする必要があります。この時点で私の問題が始まります。タイタンのマニュアルを参照し、私は(グレムリンを使用して)、次の手順を実行する必要があります。10分のタイムアウト後

import com.thinkaurelius.titan.graphdb.database.management.ManagementSystem 

// Rollback or commit transactions on the graph which predate the index definition 
graph.tx().rollback() 

// Block until the SchemaStatus transitions from INSTALLED to REGISTERED 
ManagementSystem.awaitGraphIndexStatus(graph, "users") 
    .status(SchemaStatus.REGISTERED) 
    .timeout(10, ChronoUnit.MINUTES) // set timeout to 10 
    .call() 

受けた答え:

==>GraphIndexStatusReport[success=false, indexName='users', targetStatus=REGISTERED, 
    notConverged={age=INSTALLED, fullName=ENABLED, userId=ENABLED, 
    userRegisterDate=ENABLED, userGender=ENABLED, email=ENABLED}, 
    converged={}, elapsed=PT10M0.173S] 

そして今、私はのようにインデックスを再作成しようとした場合次の:

tm = graph.openManagement() 
tm.updateIndex(tm.getGraphIndex("users"), SchemaAction.REINDEX).get() 
tm.commit() 

私はエラーが表示されます。

WARN com.thinkaurelius.titan.graphdb.olap.job.IndexRepairJob - Index users has key age in an invalid status INSTALLED 
ERROR com.thinkaurelius.titan.diskstorage.keycolumnvalue.scan.StandardScannerExecutor - Exception trying to setup the job: 
com.thinkaurelius.titan.core.TitanException: The index users is in an invalid state and cannot be indexed. The following index keys have invalid status: age has status INSTALLED (status must be one of [REGISTERED, ENABLED]) 

私が間違っていることは何ですか?

+0

'tm.updateIndex(tm.getGraphIndex(" users ")、SchemaAction.REINDEX)'の後に '.get()'の呼び出しを連鎖できますか?あなたは、その部分をドキュメントの例から逃しました。 – jbmusso

+0

@jbmussoはい、私は '.get()'メソッド呼び出しを試みました。間違いをコピー/貼り付け、自分の質問を編集しました。 – OctopusSD

答えて

0

既存のインデックスに新しいプロパティを追加することはできません。 docsを確認してください。

+0

Titan v1.0.0の文書によれば、[これは混合インデックスのために行うことができます](http://s3.thinkaurelius.com/docs/titan/1.0.0/indexes.html#index-mixed)。 – jbmusso

+0

どこ?既存の混合インデックスに新しいプロパティを追加することができるというセクションを挙げてください。 –

+0

@MTA Titan 1.0.0のドキュメント[8.1.2.1](http://s3.thinkaurelius.com/docs/titan/1.0.0/indexes.html#_adding_property_keys)のセクションをチェックしてください: "_プロパティキーにはすでに使用されている場合、キーを追加するには、索引に以前に追加されたすべての要素が含まれていることを確認するために**再索引プロシージャ**を実行する必要があります。 " – OctopusSD

関連する問題