You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: meilisearch/index.py
+88-13Lines changed: 88 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -482,6 +482,7 @@ def add_documents(
482
482
primary_key: Optional[str] =None,
483
483
*,
484
484
serializer: Optional[Type[JSONEncoder]] =None,
485
+
skip_creation: Optional[bool] =None,
485
486
) ->TaskInfo:
486
487
"""Add documents to the index.
487
488
@@ -494,6 +495,9 @@ def add_documents(
494
495
serializer (optional):
495
496
A custom JSONEncode to handle serializing fields that the build in json.dumps
496
497
cannot handle, for example UUID and datetime.
498
+
skip_creation (optional):
499
+
If True, documents that don't exist in the index are silently ignored rather
500
+
than created. If False or None (default), existing behavior is preserved.
497
501
498
502
Returns
499
503
-------
@@ -506,7 +510,7 @@ def add_documents(
506
510
MeilisearchApiError
507
511
An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://www.meilisearch.com/docs/reference/errors/error_codes#meilisearch-errors
"""Add documents to the index from a byte-encoded JSON string.
564
575
@@ -571,6 +582,9 @@ def add_documents_json(
571
582
serializer (optional):
572
583
A custom JSONEncode to handle serializing fields that the build in json.dumps
573
584
cannot handle, for example UUID and datetime.
585
+
skip_creation (optional):
586
+
If True, documents that don't exist in the index are silently ignored rather
587
+
than created. If False or None (default), existing behavior is preserved.
574
588
575
589
Returns
576
590
-------
@@ -584,14 +598,19 @@ def add_documents_json(
584
598
An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://www.meilisearch.com/docs/reference/errors/error_codes#meilisearch-errors
"""Add documents to the index from a byte-encoded CSV string.
597
616
@@ -603,6 +622,9 @@ def add_documents_csv(
603
622
The primary-key used in index. Ignored if already set up.
604
623
csv_delimiter:
605
624
One ASCII character used to customize the delimiter for CSV. Comma used by default.
625
+
skip_creation (optional):
626
+
If True, documents that don't exist in the index are silently ignored rather
627
+
than created. If False or None (default), existing behavior is preserved.
606
628
607
629
Returns
608
630
-------
@@ -615,12 +637,15 @@ def add_documents_csv(
615
637
MeilisearchApiError
616
638
An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://www.meilisearch.com/docs/reference/errors/error_codes#meilisearch-errors
"""Add documents to the index from a byte-encoded NDJSON string.
626
651
@@ -630,6 +655,9 @@ def add_documents_ndjson(
630
655
Byte-encoded NDJSON string.
631
656
primary_key (optional):
632
657
The primary-key used in index. Ignored if already set up.
658
+
skip_creation (optional):
659
+
If True, documents that don't exist in the index are silently ignored rather
660
+
than created. If False or None (default), existing behavior is preserved.
633
661
634
662
Returns
635
663
-------
@@ -642,7 +670,9 @@ def add_documents_ndjson(
642
670
MeilisearchApiError
643
671
An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://www.meilisearch.com/docs/reference/errors/error_codes#meilisearch-errors
"""Add documents to the index from a byte-encoded string.
657
688
@@ -669,6 +700,9 @@ def add_documents_raw(
669
700
serializer (optional):
670
701
A custom JSONEncode to handle serializing fields that the build in json.dumps
671
702
cannot handle, for example UUID and datetime.
703
+
skip_creation (optional):
704
+
If True, documents that don't exist in the index are silently ignored rather
705
+
than created. If False or None (default), existing behavior is preserved.
672
706
673
707
Returns
674
708
-------
@@ -681,7 +715,9 @@ def add_documents_raw(
681
715
MeilisearchApiError
682
716
An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://www.meilisearch.com/docs/reference/errors/error_codes#meilisearch-errors
A custom JSONEncode to handle serializing fields that the build in json.dumps
705
742
cannot handle, for example UUID and datetime.
743
+
skip_creation (optional):
744
+
If True, documents that don't exist in the index are silently ignored rather
745
+
than created. If False or None (default), existing behavior is preserved.
706
746
707
747
Returns
708
748
-------
@@ -715,14 +755,15 @@ def update_documents(
715
755
MeilisearchApiError
716
756
An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://www.meilisearch.com/docs/reference/errors/error_codes#meilisearch-errors
An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://www.meilisearch.com/docs/reference/errors/error_codes#meilisearch-errors
"""Update documents as a json string in the index.
757
804
@@ -764,6 +811,9 @@ def update_documents_json(
764
811
serializer (optional):
765
812
A custom JSONEncode to handle serializing fields that the build in json.dumps
766
813
cannot handle, for example UUID and datetime.
814
+
skip_creation (optional):
815
+
If True, documents that don't exist in the index are silently ignored rather
816
+
than created. If False or None (default), existing behavior is preserved.
767
817
768
818
Returns
769
819
-------
@@ -777,14 +827,19 @@ def update_documents_json(
777
827
An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://www.meilisearch.com/docs/reference/errors/error_codes#meilisearch-errors
The primary-key used in index. Ignored if already set up.
797
852
csv_delimiter:
798
853
One ASCII character used to customize the delimiter for CSV. Comma used by default.
854
+
skip_creation (optional):
855
+
If True, documents that don't exist in the index are silently ignored rather
856
+
than created. If False or None (default), existing behavior is preserved.
799
857
800
858
Returns
801
859
-------
@@ -808,7 +866,9 @@ def update_documents_csv(
808
866
MeilisearchApiError
809
867
An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://www.meilisearch.com/docs/reference/errors/error_codes#meilisearch-errors
A custom JSONEncode to handle serializing fields that the build in json.dumps
837
898
cannot handle, for example UUID and datetime.
899
+
skip_creation (optional):
900
+
If True, documents that don't exist in the index are silently ignored rather
901
+
than created. If False or None (default), existing behavior is preserved.
838
902
839
903
Returns
840
904
-------
@@ -847,7 +911,9 @@ def update_documents_raw(
847
911
MeilisearchApiError
848
912
An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://www.meilisearch.com/docs/reference/errors/error_codes#meilisearch-errors
0 commit comments