Hi,

I am new to elastic search. I am using php elastica client and facing a 
problem:
If an index exists, I want to get the object of this existing index and not 
recreate it. How can this be done?

client = new \Elastica\Client($arrServerConf, $callback);

if ( $client->getIndex($name)->exists() ) {
          //do something here to get this existing object -- what to do 
here???
} else {
          // create a new one
          $index = $client->getIndex($name);
          $index->create(array('index' => array('number_of_shards' => 
$shards, 'number_of_replicas' => 0)), $delete);
}
$type = $index->getType($typeName);

Or is there some other way of doing this?
I need this because, I'll be adding documents in this index and searching 
among them.

I think its a very trivial task, should have easily found a fix, but am 
unable to fix this. Hope you guys will be kind enough to help me out.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/da2f6e7a-5f5b-4cda-b602-6e5ea362d480%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to