-
Notifications
You must be signed in to change notification settings - Fork 0
/
manticore.yml
1489 lines (1433 loc) · 38.5 KB
/
manticore.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.2
info:
title: Manticore Search Client
description: |
Сlient for Manticore Search.
version: 3.3.1
contact:
name: Manticore Software Ltd.
email: info@manticoresearch.com
url: 'https://manticoresearch.com/contact-us/'
license:
name: MIT
url: 'http://opensource.org/licenses/MIT'
tags:
- name: Index
description: 'Operations regarding adding, updating or deleting documents'
- name: Search
description: Operations about performing searches over indexes
- name: Utils
description: Various operations
externalDocs:
description: Find out more about Manticore Search
url: 'https://manticoresearch.com/'
components:
examples:
objectExample:
value: www
summary: A sample object
schemas:
fulltextFilter:
x-is_fulltext_filter: true
type: object
additionalProperties: true
example:
id: 1
attrFilter:
type: object
additionalProperties: true
aggregation:
type: object
x-is_req_agg: true
description: Aggregation Alias
properties:
terms:
type: object
properties:
field:
type: string
description: Attribute Name to Aggregate
example: field1
size:
type: integer
description: Maximum Number of Buckets in the Result
example: 1000
sort:
type: array
items:
type: object
additionalProperties:
type: object
properties:
order:
type: string
equalsFilter:
type: object
description: Equals attribute filter
x-is_equals_filter: true
required:
- field
- value
properties:
field:
type: string
value:
type: object
example: {'field1': 1}
inFilter:
type: object
description: In attribute filter
x-is_in_filter: true
required:
- field
- values
properties:
field:
type: string
values:
type: array
items:
type: object
example: {'field1': ['a','b']}
rangeFilter:
type: object
description: Range attribute filter
x-is_range_filter: true
required:
- field
properties:
field:
type: string
lte:
type: number
nullable: true
gte:
type: number
nullable: true
lt:
type: number
nullable: true
gt:
type: number
nullable: true
example: {'field1': {'gte': 10, 'lte': 20} }
geoDistanceFilter:
type: object
description: Geo distance attribute filter
x-is_geo_filter: true
properties:
location_anchor:
description: Geo pin point object
type: object
properties:
lat:
description: Geo latitude of pin point in degrees
type: number
lon:
description: Geo longitude pf pin point in degrees
type: number
location_source:
description: Attribute containing latitude and longitude data
type: string
example: 'attr_with_lat,attr_with_lon'
distance_type:
type: string
enum:
- adaptive
- haversine
distance:
type: string
example: '100 km'
example: {'field1': {'gte': 10, 'lte': 20} }
boolFilter:
type: object
x-is_bool_filter: true
description: Boolean attribute filter
properties:
should:
type: array
items:
type: object
#anyOf:
# - $ref: '#/components/schemas/fulltextFilter'
# - $ref: '#/components/schemas/attrFilter'
must:
type: array
items:
type: object
#anyOf:
# - $ref: '#/components/schemas/fulltextFilter'
# - $ref: '#/components/schemas/attrFilter'
must_not:
type: array
items:
type: object
#anyOf:
# - $ref: '#/components/schemas/fulltextFilter'
# - $ref: '#/components/schemas/attrFilter'
queryFilter:
type: object
description: Query string filter
required:
- query_string
properties:
query_string:
type: string
matchFilter:
type: object
description: Query match filter
x-is_match_filter: true
required:
- query_string
- query_fields
properties:
query_string:
type: string
default: ''
example: query
query_fields:
type: string
default: '*'
example: field1,field2
matchPhraseFilter:
type: object
description: Query match expression
x-is_match_phrase_filter: true
required:
- query_phrase
- query_fields
properties:
query_phrase:
type: string
example: 'query phrase'
query_fields:
type: string
example: field1,field2
matchOpFilter:
type: object
description: Query match expression
x-is_match_op_filter: true
required:
- query_string
- query_fields
- operator
properties:
query_string:
type: string
example: query
query_fields:
type: string
example: field1,field2
operator:
type: string
enum:
- 'or'
- 'and'
sort:
type: string
description: Query sort attribute name
x-is_sort: true
# query:
# type: object
# description: Query expression
# required:
# - match
# properties:
# match:
# $ref: '#/components/schemas/match'
matchOp:
type: object
description: Query match expression with logical operator
required:
- query_info
properties:
query_info:
type: object
required:
- query
- operator
example: {'query': 'another query', 'operator': 'and'}
offset:
type: integer
description: Query offset parameter
limit:
type: integer
description: Query offset parameter
maxMatches:
type: integer
description: Query max matches parameter
filterNumber:
type: object
description: Query filter
required:
- filter_field
- operation
- filter_value
properties:
filter_field:
type: string
example: test
operation:
type: string
example: equals
filter_value:
type: number
example: 1
filterString:
type: object
description: Query filter
required:
- filter_field
- operation
- filter_value
properties:
filter_field:
type: string
example: test
operation:
type: string
example: equals
filter_value:
type: string
example: test
filterBoolean:
type: object
description: Query filter
required:
- filter_field
- operation
- filter_value
properties:
filter_field:
type: string
example: test
operation:
type: string
example: equals
filter_value:
type: boolean
example: false
notFilterNumber:
type: object
description: Query filter
required:
- filter_field
- operation
- filter_value
properties:
filter_field:
type: string
example: test
operation:
type: string
example: equals
filter_value:
type: number
example: 1
notFilterString:
type: object
description: Query filter
required:
- filter_field
- operation
- filter_value
properties:
filter_field:
type: string
example: test
operation:
type: string
example: equals
filter_value:
type: string
example: test
notFilterBoolean:
type: object
description: Query filter
required:
- filter_field
- operation
- filter_value
properties:
filter_field:
type: string
example: test
operation:
type: string
example: equals
filter_value:
type: boolean
example: false
sortOrder:
type: object
x-is_sort_order: true
description: Query sort expression
required:
- attr
- order
properties:
attr:
type: string
example: test
order:
type: string
enum:
- asc
- desc
example: asc
sortMVA:
type: object
x-is_sort_mva: true
description: Query sort expression for MVA attributes
required:
- attr
- order
- mode
properties:
attr:
type: string
example: test
order:
type: string
enum:
- asc
- desc
example: asc
mode:
type: string
enum:
- min
- max
example: max
sortMultiple:
type: object
description: Query sort expression for multiple attributes
required:
- attrs
- replace
properties:
attrs:
type: object
additionalProperties: true
example: {"name": "desc", "title": "asc"}
replace:
type: boolean
example: tru
highlightField:
type: object
x-is_highlight_field: true
description: Query Highlight field with options set
required:
- name
properties:
name:
type: string
limit:
type: integer
default: 256
limit_words:
type: integer
default: 0
limit_snippets:
type: integer
default: 0
highlight:
type: object
x-is_req_highlight: true
description: Query HIGHLIGHT expression
properties:
fieldnames:
type: array
items:
type: string
example: ['title','content']
fields:
type: array
items:
$ref: '#/components/schemas/highlightField'
encoder:
type: string
enum:
- default
- html
highlight_query:
#$ref: '#/components/schemas/queryFilter'
type: object
additionalProperties: true
nullable: true
pre_tags:
type: string
default: '<strong>'
post_tags:
type: string
default: '</strong>'
no_match_size:
type: integer
#default: 1
enum:
- 0
- 1
fragment_size:
type: integer
default: 256
number_of_fragments:
type: integer
default: 0
limit:
type: integer
default: 256
limit_words:
type: integer
default: 0
limit_snippets:
type: integer
default: 0
limits_per_field:
type: boolean
default: false
use_boundaries:
type: boolean
default: false
force_all_words:
type: boolean
default: false
allow_empty:
type: boolean
default: false
emit_zones:
type: boolean
default: false
force_snippets:
type: boolean
default: false
around:
type: integer
default: 5
start_snippet_id:
type: integer
default: 1
html_strip_mode:
type: string
enum:
- 'none'
- 'strip'
- 'index'
- 'retain'
snippet_boundary:
type: string
enum:
- 'sentence'
- 'paragraph'
- 'zone'
example: {"fields": ["title"], "pre_tags": "<i>", "post_tags": "</i>"}
source:
type: string
description: Query fields to be returned
example: attr*
sourceMultiple:
type: array
description: Query fields to be returned
items:
type: string
example: ['attr1','attr2']
sourceByRules:
x-is_source_by_rules: true
type: object
description: Query fields to be included/excluded to/from response
required:
- includes
- excludes
properties:
includes:
type: array
default: []
items:
type: string
excludes:
type: array
default: ['']
items:
type: string
example: {"includes": ["attr1","attri*"], "excludes": ["desc*"]}
facet:
type: object
description: Query FACET expression
required:
- attr
properties:
attr:
type: string
description: The name of an attribute to facet
alias:
type: string
description: Facet alias
limit:
type: integer
description: The number of facet values to return
example: {"attr": "title", "alias": "some_facet", "limit": 1}
option:
type: object
description: Query OPTION expression
additionalProperties: true
example: {"cutoff": 1, "retry_count": 3, "field_weights": {"title": 10, "description": 20}}
trackScores:
type: boolean
description: Enables weight calculation for the query
profile:
type: boolean
description: Enables query profiling
reset:
type: boolean
description: Clears all search conditions
searchRequest:
type: object
x-is_search_req: true
description: Request object for search operation
required:
- index
#- query
properties:
index:
type: string
default: ''
example: test
query:
type: object
x-is_req_query: true
# allOf:
# - $ref: '#/components/schemas/query'
# - x-is_req_query: true
example:
match_all: {}
fulltext_filter:
x-is_fulltext_filter: true
type: object
example: {}
#$ref: '#/components/schemas/fulltextFilter'
#allOf:
#- $ref: '#/components/schemas/fulltextFilter'
#- x-is_fulltext_filter: true
attr_filter:
x-is_attr_filter: true
example: {}
type: object
#allOf:
# - $ref: '#/components/schemas/attrFilter'
# - x-is_attr_filter: true
limit:
type: integer
offset:
type: integer
max_matches:
type: integer
sort:
type: array
items:
type: object
#oneOf:
# - $ref: '#/components/schemas/sort'
# - $ref: '#/components/schemas/sortOrder'
# - $ref: '#/components/schemas/sortMVA'
example: []
aggs:
type: object
additionalProperties:
$ref: '#/components/schemas/aggregation'
example:
agg1:
terms:
field: field1
size: 1000
sort:
- 'field1':
order: asc
expressions:
type: object
additionalProperties:
type: string
example:
title_len: "crc32(title)"
highlight:
$ref: '#/components/schemas/highlight'
source:
x-is_req_source: true
type: object
example: {}
#oneOf:
# - type: object
# - type: string
# - $ref: '#/components/schemas/source'
# - $ref: '#/components/schemas/sourceByRules'
options:
type: object
additionalProperties: true
profile:
type: boolean
track_scores:
type: boolean
example:
index:
$ref: '#/components/examples/objectExample'
updateDocumentRequest:
type: object
description: Payload for update document
required:
- index
- doc
properties:
index:
type: string
doc:
type: object
description: Index name
additionalProperties: true
example:
gid: 10
id:
type: integer
format: int64
description: Document ID
query:
type: object
additionalProperties: true
nullable: true
description: Query tree object
example:
query:
match:
title: match me
example:
index: test
doc:
price: 1000
query:
match:
'*': apple
deleteDocumentRequest:
type: object
description: >
Payload for delete request.
Documents can be deleted either one by one by specifying the document id
or by providing a query object.
For more information see
[Delete API](https://manual.manticoresearch.com/Deleting_documents)
required:
- index
properties:
index:
type: string
description: Index name
cluster:
type: string
description: cluster name
id:
type: integer
format: int64
description: Document ID
query:
type: object
description: Query tree object
example:
index: test
id: 1
insertDocumentRequest:
type: object
description: |
Object with document data.
required:
- index
- doc
properties:
index:
type: string
description: Name of the index
cluster:
type: string
description: cluster name
id:
type: integer
format: int64
description: |
Document ID.
doc:
type: object
additionalProperties: true
description: |
Object with document data
example:
index: test
doc:
title: This is some title
gid: 100
percolateRequest:
type: object
description: Object with documents to percolate
required:
- query
properties:
query:
type: object
additionalProperties: true
required:
- percolate
properties:
percolate:
type: object
example:
percolate:
document:
title: some text to match
example:
query:
percolate:
document:
title: some text to match
searchResponse:
type: object
description: Response object of a search request
properties:
took:
type: integer
timed_out:
type: boolean
aggregations:
type: object
additionalProperties: true
hits:
type: object
properties:
max_score:
type: integer
total:
type: integer
total_relation:
type: string
hits:
type: array
items:
type: object
example:
total: 2
hits:
- _id: 1
_score: 1
_source:
gid: 11
- _id: 2
_score: 1
_source:
gid: 20
profile:
type: object
warning:
type: object
additionalProperties: true
sqlResponse:
type: array
items:
type: object
description: List containing Response object from sql that depends on the query executed as its item.
example:
- total: 0
error: null
successResponse:
type: object
description: Success response
properties:
_index:
type: string
_id:
type: integer
format: int64
created:
type: boolean
result:
type: string
found:
type: boolean
example:
_index: test
_id: 1
result: created
created: true
bulkResponse:
type: object
additionalProperties: true
description: Success bulk response
properties:
items:
type: object
errors:
type: boolean
error:
type: string
updateResponse:
type: object
description: Success response
properties:
_index:
type: string
updated:
type: integer
_id:
type: integer
format: int64
result:
type: string
example:
_index: test
updated: 29
deleteResponse:
type: object
description: Success response
properties:
_index:
type: string
deleted:
type: integer
_id:
type: integer
format: int64
result:
type: string
example:
_index: test
deleted: 29
errorResponse:
type: object
description: Error response
required:
- error
- status
properties:
error:
type: object
additionalProperties: true
status:
type: integer
example: 500
example:
status: 500
error: an error occured
paths:
'/pq/{index}/search':
post:
summary: Perform reverse search on a percolate index
x-is_percolate: true
operationId: percolate
description: >
Performs a percolate search.
This method must be used only on percolate indexes.
Expects two parameters: the index name and an object with
array of documents to be tested.
An example of the documents object:
```
{
"query":
{
"percolate":
{
"document":
{
"content":"sample content"
}
}
}
}
```
Responds with an object with matched stored queries:
```
{
'timed_out':false,
'hits':
{
'total':2,
'max_score':1,
'hits':
[
{
'_index':'idx_pq_1',
'_type':'doc',
'_id':'2',
'_score':'1',
'_source':
{
'query':
{
'match':{'title':'some'}
}
}
},
{
'_index':'idx_pq_1',
'_type':'doc',
'_id':'5',
'_score':'1',
'_source':
{
'query':
{
'ql':'some | none'
}
}
}
]
}
}
```
tags:
- Search
externalDocs:
url: 'https://manual.manticoresearch.com/Updating_documents/UPDATE'
parameters:
- in: path
name: index
schema:
type: string
required: true
description: Name of the percolate index
requestBody:
required: true