relevanced_client 0.9.6 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gen-rb/relevanced.rb +593 -353
- data/lib/gen-rb/relevanced_protocol_types.rb +290 -9
- data/lib/relevanced_client.rb +99 -47
- metadata +2 -2
@@ -312,6 +312,25 @@ class CreateDocumentResponse
|
|
312
312
|
::Thrift::Struct.generate_accessors self
|
313
313
|
end
|
314
314
|
|
315
|
+
class DeleteDocumentRequest
|
316
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
317
|
+
ID = 1
|
318
|
+
IGNOREMISSING = 2
|
319
|
+
|
320
|
+
FIELDS = {
|
321
|
+
ID => {:type => ::Thrift::Types::STRING, :name => 'id'},
|
322
|
+
IGNOREMISSING => {:type => ::Thrift::Types::BOOL, :name => 'ignoreMissing', :optional => true}
|
323
|
+
}
|
324
|
+
|
325
|
+
def struct_fields; FIELDS; end
|
326
|
+
|
327
|
+
def validate
|
328
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field id is unset!') unless @id
|
329
|
+
end
|
330
|
+
|
331
|
+
::Thrift::Struct.generate_accessors self
|
332
|
+
end
|
333
|
+
|
315
334
|
class DeleteDocumentResponse
|
316
335
|
include ::Thrift::Struct, ::Thrift::Struct_Union
|
317
336
|
ID = 1
|
@@ -329,12 +348,158 @@ class DeleteDocumentResponse
|
|
329
348
|
::Thrift::Struct.generate_accessors self
|
330
349
|
end
|
331
350
|
|
351
|
+
class MultiDeleteDocumentsRequest
|
352
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
353
|
+
IDS = 1
|
354
|
+
IGNOREMISSING = 2
|
355
|
+
|
356
|
+
FIELDS = {
|
357
|
+
IDS => {:type => ::Thrift::Types::LIST, :name => 'ids', :element => {:type => ::Thrift::Types::STRING}},
|
358
|
+
IGNOREMISSING => {:type => ::Thrift::Types::BOOL, :name => 'ignoreMissing', :optional => true}
|
359
|
+
}
|
360
|
+
|
361
|
+
def struct_fields; FIELDS; end
|
362
|
+
|
363
|
+
def validate
|
364
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field ids is unset!') unless @ids
|
365
|
+
end
|
366
|
+
|
367
|
+
::Thrift::Struct.generate_accessors self
|
368
|
+
end
|
369
|
+
|
370
|
+
class MultiDeleteDocumentsResponse
|
371
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
372
|
+
IDS = 1
|
373
|
+
|
374
|
+
FIELDS = {
|
375
|
+
IDS => {:type => ::Thrift::Types::LIST, :name => 'ids', :element => {:type => ::Thrift::Types::STRING}}
|
376
|
+
}
|
377
|
+
|
378
|
+
def struct_fields; FIELDS; end
|
379
|
+
|
380
|
+
def validate
|
381
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field ids is unset!') unless @ids
|
382
|
+
end
|
383
|
+
|
384
|
+
::Thrift::Struct.generate_accessors self
|
385
|
+
end
|
386
|
+
|
387
|
+
class MultiDeleteCentroidsRequest
|
388
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
389
|
+
IDS = 1
|
390
|
+
IGNOREMISSING = 2
|
391
|
+
|
392
|
+
FIELDS = {
|
393
|
+
IDS => {:type => ::Thrift::Types::LIST, :name => 'ids', :element => {:type => ::Thrift::Types::STRING}},
|
394
|
+
IGNOREMISSING => {:type => ::Thrift::Types::BOOL, :name => 'ignoreMissing', :optional => true}
|
395
|
+
}
|
396
|
+
|
397
|
+
def struct_fields; FIELDS; end
|
398
|
+
|
399
|
+
def validate
|
400
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field ids is unset!') unless @ids
|
401
|
+
end
|
402
|
+
|
403
|
+
::Thrift::Struct.generate_accessors self
|
404
|
+
end
|
405
|
+
|
406
|
+
class MultiDeleteCentroidsResponse
|
407
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
408
|
+
IDS = 1
|
409
|
+
|
410
|
+
FIELDS = {
|
411
|
+
IDS => {:type => ::Thrift::Types::LIST, :name => 'ids', :element => {:type => ::Thrift::Types::STRING}}
|
412
|
+
}
|
413
|
+
|
414
|
+
def struct_fields; FIELDS; end
|
415
|
+
|
416
|
+
def validate
|
417
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field ids is unset!') unless @ids
|
418
|
+
end
|
419
|
+
|
420
|
+
::Thrift::Struct.generate_accessors self
|
421
|
+
end
|
422
|
+
|
332
423
|
class CreateCentroidResponse
|
424
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
425
|
+
CREATED = 1
|
426
|
+
|
427
|
+
FIELDS = {
|
428
|
+
CREATED => {:type => ::Thrift::Types::STRING, :name => 'created'}
|
429
|
+
}
|
430
|
+
|
431
|
+
def struct_fields; FIELDS; end
|
432
|
+
|
433
|
+
def validate
|
434
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field created is unset!') unless @created
|
435
|
+
end
|
436
|
+
|
437
|
+
::Thrift::Struct.generate_accessors self
|
438
|
+
end
|
439
|
+
|
440
|
+
class CreateCentroidRequest
|
333
441
|
include ::Thrift::Struct, ::Thrift::Struct_Union
|
334
442
|
ID = 1
|
443
|
+
IGNOREEXISTING = 2
|
335
444
|
|
336
445
|
FIELDS = {
|
337
|
-
ID => {:type => ::Thrift::Types::STRING, :name => 'id'}
|
446
|
+
ID => {:type => ::Thrift::Types::STRING, :name => 'id'},
|
447
|
+
IGNOREEXISTING => {:type => ::Thrift::Types::BOOL, :name => 'ignoreExisting', :optional => true}
|
448
|
+
}
|
449
|
+
|
450
|
+
def struct_fields; FIELDS; end
|
451
|
+
|
452
|
+
def validate
|
453
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field id is unset!') unless @id
|
454
|
+
end
|
455
|
+
|
456
|
+
::Thrift::Struct.generate_accessors self
|
457
|
+
end
|
458
|
+
|
459
|
+
class MultiCreateCentroidsRequest
|
460
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
461
|
+
IDS = 1
|
462
|
+
IGNOREEXISTING = 2
|
463
|
+
|
464
|
+
FIELDS = {
|
465
|
+
IDS => {:type => ::Thrift::Types::LIST, :name => 'ids', :element => {:type => ::Thrift::Types::STRING}},
|
466
|
+
IGNOREEXISTING => {:type => ::Thrift::Types::BOOL, :name => 'ignoreExisting', :optional => true}
|
467
|
+
}
|
468
|
+
|
469
|
+
def struct_fields; FIELDS; end
|
470
|
+
|
471
|
+
def validate
|
472
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field ids is unset!') unless @ids
|
473
|
+
end
|
474
|
+
|
475
|
+
::Thrift::Struct.generate_accessors self
|
476
|
+
end
|
477
|
+
|
478
|
+
class MultiCreateCentroidsResponse
|
479
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
480
|
+
CREATED = 1
|
481
|
+
|
482
|
+
FIELDS = {
|
483
|
+
CREATED => {:type => ::Thrift::Types::LIST, :name => 'created', :element => {:type => ::Thrift::Types::STRING}}
|
484
|
+
}
|
485
|
+
|
486
|
+
def struct_fields; FIELDS; end
|
487
|
+
|
488
|
+
def validate
|
489
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field created is unset!') unless @created
|
490
|
+
end
|
491
|
+
|
492
|
+
::Thrift::Struct.generate_accessors self
|
493
|
+
end
|
494
|
+
|
495
|
+
class DeleteCentroidRequest
|
496
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
497
|
+
ID = 1
|
498
|
+
IGNOREMISSING = 2
|
499
|
+
|
500
|
+
FIELDS = {
|
501
|
+
ID => {:type => ::Thrift::Types::STRING, :name => 'id'},
|
502
|
+
IGNOREMISSING => {:type => ::Thrift::Types::BOOL, :name => 'ignoreMissing', :optional => true}
|
338
503
|
}
|
339
504
|
|
340
505
|
def struct_fields; FIELDS; end
|
@@ -363,41 +528,157 @@ class DeleteCentroidResponse
|
|
363
528
|
::Thrift::Struct.generate_accessors self
|
364
529
|
end
|
365
530
|
|
366
|
-
class
|
531
|
+
class AddDocumentsToCentroidRequest
|
367
532
|
include ::Thrift::Struct, ::Thrift::Struct_Union
|
368
533
|
CENTROIDID = 1
|
369
|
-
|
534
|
+
DOCUMENTIDS = 2
|
535
|
+
IGNOREMISSINGDOCUMENT = 3
|
536
|
+
IGNOREMISSINGCENTROID = 4
|
537
|
+
IGNOREALREADYINCENTROID = 5
|
370
538
|
|
371
539
|
FIELDS = {
|
372
540
|
CENTROIDID => {:type => ::Thrift::Types::STRING, :name => 'centroidId'},
|
373
|
-
|
541
|
+
DOCUMENTIDS => {:type => ::Thrift::Types::LIST, :name => 'documentIds', :element => {:type => ::Thrift::Types::STRING}},
|
542
|
+
IGNOREMISSINGDOCUMENT => {:type => ::Thrift::Types::BOOL, :name => 'ignoreMissingDocument', :optional => true},
|
543
|
+
IGNOREMISSINGCENTROID => {:type => ::Thrift::Types::BOOL, :name => 'ignoreMissingCentroid', :optional => true},
|
544
|
+
IGNOREALREADYINCENTROID => {:type => ::Thrift::Types::BOOL, :name => 'ignoreAlreadyInCentroid', :optional => true}
|
374
545
|
}
|
375
546
|
|
376
547
|
def struct_fields; FIELDS; end
|
377
548
|
|
378
549
|
def validate
|
379
550
|
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field centroidId is unset!') unless @centroidId
|
380
|
-
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field
|
551
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field documentIds is unset!') unless @documentIds
|
381
552
|
end
|
382
553
|
|
383
554
|
::Thrift::Struct.generate_accessors self
|
384
555
|
end
|
385
556
|
|
386
|
-
class
|
557
|
+
class AddDocumentsToCentroidResponse
|
387
558
|
include ::Thrift::Struct, ::Thrift::Struct_Union
|
388
559
|
CENTROIDID = 1
|
389
|
-
|
560
|
+
DOCUMENTIDS = 2
|
561
|
+
ADDED = 3
|
390
562
|
|
391
563
|
FIELDS = {
|
392
564
|
CENTROIDID => {:type => ::Thrift::Types::STRING, :name => 'centroidId'},
|
393
|
-
|
565
|
+
DOCUMENTIDS => {:type => ::Thrift::Types::LIST, :name => 'documentIds', :element => {:type => ::Thrift::Types::STRING}},
|
566
|
+
ADDED => {:type => ::Thrift::Types::LIST, :name => 'added', :element => {:type => ::Thrift::Types::BOOL}}
|
394
567
|
}
|
395
568
|
|
396
569
|
def struct_fields; FIELDS; end
|
397
570
|
|
398
571
|
def validate
|
399
572
|
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field centroidId is unset!') unless @centroidId
|
400
|
-
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field
|
573
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field documentIds is unset!') unless @documentIds
|
574
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field added is unset!') unless @added
|
575
|
+
end
|
576
|
+
|
577
|
+
::Thrift::Struct.generate_accessors self
|
578
|
+
end
|
579
|
+
|
580
|
+
class RemoveDocumentsFromCentroidRequest
|
581
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
582
|
+
CENTROIDID = 1
|
583
|
+
DOCUMENTIDS = 2
|
584
|
+
IGNOREMISSINGDOCUMENT = 3
|
585
|
+
IGNOREMISSINGCENTROID = 4
|
586
|
+
IGNORENOTINCENTROID = 5
|
587
|
+
|
588
|
+
FIELDS = {
|
589
|
+
CENTROIDID => {:type => ::Thrift::Types::STRING, :name => 'centroidId'},
|
590
|
+
DOCUMENTIDS => {:type => ::Thrift::Types::LIST, :name => 'documentIds', :element => {:type => ::Thrift::Types::STRING}},
|
591
|
+
IGNOREMISSINGDOCUMENT => {:type => ::Thrift::Types::BOOL, :name => 'ignoreMissingDocument', :optional => true},
|
592
|
+
IGNOREMISSINGCENTROID => {:type => ::Thrift::Types::BOOL, :name => 'ignoreMissingCentroid', :optional => true},
|
593
|
+
IGNORENOTINCENTROID => {:type => ::Thrift::Types::BOOL, :name => 'ignoreNotInCentroid', :optional => true}
|
594
|
+
}
|
595
|
+
|
596
|
+
def struct_fields; FIELDS; end
|
597
|
+
|
598
|
+
def validate
|
599
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field centroidId is unset!') unless @centroidId
|
600
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field documentIds is unset!') unless @documentIds
|
601
|
+
end
|
602
|
+
|
603
|
+
::Thrift::Struct.generate_accessors self
|
604
|
+
end
|
605
|
+
|
606
|
+
class RemoveDocumentsFromCentroidResponse
|
607
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
608
|
+
CENTROIDID = 1
|
609
|
+
DOCUMENTIDS = 2
|
610
|
+
REMOVED = 3
|
611
|
+
|
612
|
+
FIELDS = {
|
613
|
+
CENTROIDID => {:type => ::Thrift::Types::STRING, :name => 'centroidId'},
|
614
|
+
DOCUMENTIDS => {:type => ::Thrift::Types::LIST, :name => 'documentIds', :element => {:type => ::Thrift::Types::STRING}},
|
615
|
+
REMOVED => {:type => ::Thrift::Types::LIST, :name => 'removed', :element => {:type => ::Thrift::Types::BOOL}}
|
616
|
+
}
|
617
|
+
|
618
|
+
def struct_fields; FIELDS; end
|
619
|
+
|
620
|
+
def validate
|
621
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field centroidId is unset!') unless @centroidId
|
622
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field documentIds is unset!') unless @documentIds
|
623
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field removed is unset!') unless @removed
|
624
|
+
end
|
625
|
+
|
626
|
+
::Thrift::Struct.generate_accessors self
|
627
|
+
end
|
628
|
+
|
629
|
+
class MultiJoinCentroidsRequest
|
630
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
631
|
+
IDS = 1
|
632
|
+
IGNOREMISSING = 2
|
633
|
+
|
634
|
+
FIELDS = {
|
635
|
+
IDS => {:type => ::Thrift::Types::LIST, :name => 'ids', :element => {:type => ::Thrift::Types::STRING}},
|
636
|
+
IGNOREMISSING => {:type => ::Thrift::Types::BOOL, :name => 'ignoreMissing', :optional => true}
|
637
|
+
}
|
638
|
+
|
639
|
+
def struct_fields; FIELDS; end
|
640
|
+
|
641
|
+
def validate
|
642
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field ids is unset!') unless @ids
|
643
|
+
end
|
644
|
+
|
645
|
+
::Thrift::Struct.generate_accessors self
|
646
|
+
end
|
647
|
+
|
648
|
+
class MultiJoinCentroidsResponse
|
649
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
650
|
+
IDS = 1
|
651
|
+
RECALCULATED = 2
|
652
|
+
|
653
|
+
FIELDS = {
|
654
|
+
IDS => {:type => ::Thrift::Types::LIST, :name => 'ids', :element => {:type => ::Thrift::Types::STRING}},
|
655
|
+
RECALCULATED => {:type => ::Thrift::Types::LIST, :name => 'recalculated', :element => {:type => ::Thrift::Types::BOOL}}
|
656
|
+
}
|
657
|
+
|
658
|
+
def struct_fields; FIELDS; end
|
659
|
+
|
660
|
+
def validate
|
661
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field ids is unset!') unless @ids
|
662
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field recalculated is unset!') unless @recalculated
|
663
|
+
end
|
664
|
+
|
665
|
+
::Thrift::Struct.generate_accessors self
|
666
|
+
end
|
667
|
+
|
668
|
+
class JoinCentroidRequest
|
669
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
670
|
+
ID = 1
|
671
|
+
IGNOREMISSING = 2
|
672
|
+
|
673
|
+
FIELDS = {
|
674
|
+
ID => {:type => ::Thrift::Types::STRING, :name => 'id'},
|
675
|
+
IGNOREMISSING => {:type => ::Thrift::Types::BOOL, :name => 'ignoreMissing', :optional => true}
|
676
|
+
}
|
677
|
+
|
678
|
+
def struct_fields; FIELDS; end
|
679
|
+
|
680
|
+
def validate
|
681
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field id is unset!') unless @id
|
401
682
|
end
|
402
683
|
|
403
684
|
::Thrift::Struct.generate_accessors self
|
data/lib/relevanced_client.rb
CHANGED
@@ -21,32 +21,30 @@ module RelevancedClient
|
|
21
21
|
@thrift_transport.open()
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
def get_server_metadata()
|
29
|
-
@thrift_client.getServerMetadata()
|
24
|
+
def add_document_to_centroid(centroid_id, document_id, ignore_already_in_centroid=false)
|
25
|
+
add_documents_to_centroid(centroid_id, [document_id], ignore_already_in_centroid)
|
30
26
|
end
|
31
27
|
|
32
|
-
def
|
33
|
-
|
28
|
+
def add_documents_to_centroid(centroid_id, document_ids, ignore_already_in_centroid=false)
|
29
|
+
request = AddDocumentsToCentroidRequest.new
|
30
|
+
request.centroidId = centroid_id
|
31
|
+
request.documentIds = document_ids
|
32
|
+
request.ignoreAlreadyInCentroid = ignore_already_in_centroid
|
33
|
+
@thrift_client.addDocumentsToCentroid(request)
|
34
34
|
end
|
35
35
|
|
36
|
-
def
|
37
|
-
@thrift_client.
|
38
|
-
centroid_id_list, text, lang
|
39
|
-
)
|
36
|
+
def create_document(text, lang=Language::EN)
|
37
|
+
@thrift_client.createDocument(text, lang)
|
40
38
|
end
|
41
39
|
|
42
|
-
def
|
43
|
-
@thrift_client.
|
44
|
-
|
40
|
+
def create_document_with_id(document_id, text, lang=Language::EN)
|
41
|
+
@thrift_client.createDocumentWithID(
|
42
|
+
document_id, text, lang
|
45
43
|
)
|
46
44
|
end
|
47
45
|
|
48
|
-
def
|
49
|
-
@thrift_client.
|
46
|
+
def get_server_metadata()
|
47
|
+
@thrift_client.getServerMetadata()
|
50
48
|
end
|
51
49
|
|
52
50
|
def get_centroid_similarity(centroid_1_id, centroid_2_id)
|
@@ -55,60 +53,101 @@ module RelevancedClient
|
|
55
53
|
)
|
56
54
|
end
|
57
55
|
|
58
|
-
def
|
59
|
-
@thrift_client.
|
56
|
+
def get_document_similarity(centroid_id, document_id)
|
57
|
+
@thrift_client.getDocumentSimilarity(centroid_id, document_id)
|
60
58
|
end
|
61
59
|
|
62
|
-
def
|
63
|
-
@thrift_client.
|
64
|
-
document_id, text, lang
|
65
|
-
)
|
60
|
+
def get_text_similarity(centroid_id, text, lang=Language::EN)
|
61
|
+
@thrift_client.getTextSimilarity(centroid_id, text, lang)
|
66
62
|
end
|
67
63
|
|
68
|
-
def
|
69
|
-
|
64
|
+
def create_centroid(centroid_id, ignore_existing=false)
|
65
|
+
request = CreateCentroidRequest.new
|
66
|
+
request.id = centroid_id
|
67
|
+
request.ignoreExisting = ignore_existing
|
68
|
+
@thrift_client.createCentroid(request)
|
70
69
|
end
|
71
70
|
|
72
|
-
def
|
73
|
-
|
71
|
+
def delete_centroid(centroid_id, ignore_missing=false)
|
72
|
+
request = DeleteCentroidRequest.new
|
73
|
+
request.id = centroid_id
|
74
|
+
request.ignoreMissing = ignore_missing
|
75
|
+
@thrift_client.deleteCentroid(request)
|
74
76
|
end
|
75
77
|
|
76
|
-
def
|
77
|
-
|
78
|
+
def delete_document(document_id, ignore_missing=false)
|
79
|
+
request = DeleteDocumentRequest.new
|
80
|
+
request.id = document_id
|
81
|
+
request.ignoreMissing = ignore_missing
|
82
|
+
@thrift_client.deleteDocument(request)
|
78
83
|
end
|
79
84
|
|
80
|
-
def
|
81
|
-
|
85
|
+
def join_centroid(centroid_id)
|
86
|
+
request = JoinCentroidRequest.new
|
87
|
+
request.id = centroid_id
|
88
|
+
@thrift_client.joinCentroid(request)
|
82
89
|
end
|
83
90
|
|
84
|
-
def
|
85
|
-
|
91
|
+
def multi_create_centroids(centroid_ids, ignore_existing=false)
|
92
|
+
request = MultiCreateCentroidsRequest.new
|
93
|
+
request.ids = centroid_ids
|
94
|
+
request.ignoreExisting = ignore_existing
|
95
|
+
@thrift_client.multiCreateCentroids(request)
|
86
96
|
end
|
87
97
|
|
88
|
-
def
|
89
|
-
|
98
|
+
def multi_delete_centroids(centroid_ids, ignore_missing=false)
|
99
|
+
request = MultiDeleteCentroidsRequest.new
|
100
|
+
request.ids = centroid_ids
|
101
|
+
request.ignoreMissing = ignore_missing
|
102
|
+
@thrift_client.multiDeleteCentroids(request)
|
103
|
+
end
|
104
|
+
|
105
|
+
def multi_delete_documents(document_ids, ignore_missing=false)
|
106
|
+
request = MultiDeleteDocumentsRequest.new
|
107
|
+
request.ids = document_ids
|
108
|
+
request.ignoreMissing = ignore_missing
|
109
|
+
@thrift_client.multiDeleteDocuments(request)
|
90
110
|
end
|
91
111
|
|
92
|
-
def
|
93
|
-
@thrift_client.
|
94
|
-
|
112
|
+
def multi_get_document_similarity(centroid_id_list, document_id)
|
113
|
+
@thrift_client.multiGetDocumentSimilarity(
|
114
|
+
centroid_id_list, document_id
|
95
115
|
)
|
96
116
|
end
|
97
117
|
|
98
|
-
def
|
99
|
-
@thrift_client.
|
100
|
-
|
118
|
+
def multi_get_text_similarity(centroid_id_list, text, lang=Language::EN)
|
119
|
+
@thrift_client.multiGetTextSimilarity(
|
120
|
+
centroid_id_list, text, lang
|
101
121
|
)
|
102
122
|
end
|
103
123
|
|
104
|
-
def
|
105
|
-
|
124
|
+
def multi_join_centroids(centroid_ids)
|
125
|
+
request = MultiJoinCentroidsRequest.new
|
126
|
+
request.ids = centroid_ids
|
127
|
+
@thrift_client.multiJoinCentroids(request)
|
106
128
|
end
|
107
129
|
|
108
130
|
def list_all_centroids()
|
109
131
|
@thrift_client.listAllCentroids()
|
110
132
|
end
|
111
133
|
|
134
|
+
def list_all_documents()
|
135
|
+
@thrift_client.listAllDocuments()
|
136
|
+
end
|
137
|
+
|
138
|
+
def list_all_documents_for_centroid(centroid_id)
|
139
|
+
@thrift_client.listAllDocumentsForCentroid(centroid_id)
|
140
|
+
end
|
141
|
+
|
142
|
+
def list_centroid_document_range(centroid_id, offset, count)
|
143
|
+
@thrift_client.listCentroidDocumentRange(centroid_id, offset, count)
|
144
|
+
end
|
145
|
+
|
146
|
+
def list_centroid_document_range_from_id(centroid_id, document_id, count)
|
147
|
+
@thrift_client.listCentroidDocumentRangeFromID(centroid_id, document_id, count)
|
148
|
+
end
|
149
|
+
|
150
|
+
|
112
151
|
def list_centroid_range(offset, count)
|
113
152
|
@thrift_client.listCentroidRange(offset, count)
|
114
153
|
end
|
@@ -117,10 +156,6 @@ module RelevancedClient
|
|
117
156
|
@thrift_client.listCentroidRangeFromID(centroid_id, count)
|
118
157
|
end
|
119
158
|
|
120
|
-
def list_all_documents()
|
121
|
-
@thrift_client.listAllDocuments()
|
122
|
-
end
|
123
|
-
|
124
159
|
def list_document_range(offset, count)
|
125
160
|
@thrift_client.listDocumentRange(offset, count)
|
126
161
|
end
|
@@ -132,5 +167,22 @@ module RelevancedClient
|
|
132
167
|
def list_unused_documents(limit)
|
133
168
|
@thrift_client.listUnusedDocuments(limit)
|
134
169
|
end
|
170
|
+
|
171
|
+
def ping()
|
172
|
+
@thrift_client.ping()
|
173
|
+
end
|
174
|
+
|
175
|
+
def remove_document_from_centroid(centroid_id, document_id, ignore_not_in_centroid=false)
|
176
|
+
remove_documents_from_centroid(centroid_id, [document_id], ignore_not_in_centroid)
|
177
|
+
end
|
178
|
+
|
179
|
+
def remove_documents_from_centroid(centroid_id, document_ids, ignore_not_in_centroid=false)
|
180
|
+
request = RemoveDocumentsFromCentroidRequest.new
|
181
|
+
request.centroidId = centroid_id
|
182
|
+
request.documentIds = document_ids
|
183
|
+
request.ignoreNotInCentroid = ignore_not_in_centroid
|
184
|
+
@thrift_client.removeDocumentsFromCentroid(request)
|
185
|
+
end
|
186
|
+
|
135
187
|
end
|
136
188
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relevanced_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Ivey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thrift
|