Class: Couchbase::Management::SearchIndex
- Inherits:
-
Object
- Object
- Couchbase::Management::SearchIndex
- Defined in:
- lib/couchbase/management/search_index_manager.rb
Instance Attribute Summary collapse
-
#name ⇒ String
Name of the index.
-
#params ⇒ Hash
Index properties such as store type and mappings.
-
#plan_params ⇒ Hash
Plan properties such a number of replicas and number of partitions.
-
#source_name ⇒ String
Name of the source of the data for the index (e.g. bucket name).
-
#source_params ⇒ Hash
Extra parameters for the source.
-
#source_type ⇒ String
Type of the data source.
-
#source_uuid ⇒ String
The UUID of the ata source, this can be used to more tightly tie the index to a source.
-
#type ⇒ String
Type of the index.
-
#uuid ⇒ String
UUID is required for update.
Instance Method Summary collapse
-
#initialize {|self| ... } ⇒ SearchIndex
constructor
A new instance of SearchIndex.
- #to_backend ⇒ Object private
Constructor Details
#initialize {|self| ... } ⇒ SearchIndex
Returns a new instance of SearchIndex.
404 405 406 407 408 |
# File 'lib/couchbase/management/search_index_manager.rb', line 404 def initialize @type = "fulltext-index" @source_type = "couchbase" yield self if block_given? end |
Instance Attribute Details
#name ⇒ String
Returns name of the index.
377 378 379 |
# File 'lib/couchbase/management/search_index_manager.rb', line 377 def name @name end |
#params ⇒ Hash
Returns index properties such as store type and mappings.
386 387 388 |
# File 'lib/couchbase/management/search_index_manager.rb', line 386 def params @params end |
#plan_params ⇒ Hash
Returns plan properties such a number of replicas and number of partitions.
401 402 403 |
# File 'lib/couchbase/management/search_index_manager.rb', line 401 def plan_params @plan_params end |
#source_name ⇒ String
Returns name of the source of the data for the index (e.g. bucket name).
389 390 391 |
# File 'lib/couchbase/management/search_index_manager.rb', line 389 def source_name @source_name end |
#source_params ⇒ Hash
Returns extra parameters for the source. These are usually things like advanced connection and tuning.
398 399 400 |
# File 'lib/couchbase/management/search_index_manager.rb', line 398 def source_params @source_params end |
#source_type ⇒ String
Returns type of the data source.
392 393 394 |
# File 'lib/couchbase/management/search_index_manager.rb', line 392 def source_type @source_type end |
#source_uuid ⇒ String
Returns the UUID of the ata source, this can be used to more tightly tie the index to a source.
395 396 397 |
# File 'lib/couchbase/management/search_index_manager.rb', line 395 def source_uuid @source_uuid end |
#type ⇒ String
Returns type of the index.
380 381 382 |
# File 'lib/couchbase/management/search_index_manager.rb', line 380 def type @type end |
#uuid ⇒ String
Returns UUID is required for update. It provides means of ensuring consistency.
383 384 385 |
# File 'lib/couchbase/management/search_index_manager.rb', line 383 def uuid @uuid end |
Instance Method Details
#to_backend ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
411 412 413 414 415 416 417 418 419 420 421 422 423 |
# File 'lib/couchbase/management/search_index_manager.rb', line 411 def to_backend { name: name, type: type, uuid: uuid, params: (JSON.generate(params) if params), source_name: source_name, source_type: source_type, source_uuid: source_uuid, source_params: (JSON.generate(source_params) if source_params), plan_params: (JSON.generate(plan_params) if plan_params), } end |