Class: Couchbase::Management::SearchIndex

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/management/search_index_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|self| ... } ⇒ SearchIndex

Returns a new instance of SearchIndex.

Yield Parameters:



627
628
629
630
631
# File 'lib/couchbase/management/search_index_manager.rb', line 627

def initialize
  @type = "fulltext-index"
  @source_type = "couchbase"
  yield self if block_given?
end

Instance Attribute Details

#nameString

Returns name of the index.

Returns:

  • (String)

    name of the index



600
601
602
# File 'lib/couchbase/management/search_index_manager.rb', line 600

def name
  @name
end

#paramsHash

Returns index properties such as store type and mappings.

Returns:

  • (Hash)

    index properties such as store type and mappings



609
610
611
# File 'lib/couchbase/management/search_index_manager.rb', line 609

def params
  @params
end

#plan_paramsHash

Returns plan properties such a number of replicas and number of partitions.

Returns:

  • (Hash)

    plan properties such a number of replicas and number of partitions



624
625
626
# File 'lib/couchbase/management/search_index_manager.rb', line 624

def plan_params
  @plan_params
end

#source_nameString

Returns name of the source of the data for the index (e.g. bucket name).

Returns:

  • (String)

    name of the source of the data for the index (e.g. bucket name)



612
613
614
# File 'lib/couchbase/management/search_index_manager.rb', line 612

def source_name
  @source_name
end

#source_paramsHash

Returns extra parameters for the source. These are usually things like advanced connection and tuning.

Returns:

  • (Hash)

    extra parameters for the source. These are usually things like advanced connection and tuning.



621
622
623
# File 'lib/couchbase/management/search_index_manager.rb', line 621

def source_params
  @source_params
end

#source_typeString

Returns type of the data source.

Returns:

  • (String)

    type of the data source



615
616
617
# File 'lib/couchbase/management/search_index_manager.rb', line 615

def source_type
  @source_type
end

#source_uuidString

Returns the UUID of the ata source, this can be used to more tightly tie the index to a source.

Returns:

  • (String)

    the UUID of the ata source, this can be used to more tightly tie the index to a source



618
619
620
# File 'lib/couchbase/management/search_index_manager.rb', line 618

def source_uuid
  @source_uuid
end

#typeString

Returns type of the index.

Returns:

  • (String)

    type of the index



603
604
605
# File 'lib/couchbase/management/search_index_manager.rb', line 603

def type
  @type
end

#uuidString

Returns UUID is required for update. It provides means of ensuring consistency.

Returns:

  • (String)

    UUID is required for update. It provides means of ensuring consistency.



606
607
608
# File 'lib/couchbase/management/search_index_manager.rb', line 606

def uuid
  @uuid
end

Instance Method Details

#to_backendObject

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.



634
635
636
637
638
639
640
641
642
643
644
645
646
# File 'lib/couchbase/management/search_index_manager.rb', line 634

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