Liking cljdoc? Tell your friends :D

corona.index


add!clj

(add! client-config doc-or-docs & [settings])

Uploads 'doc-or-docs' (map or vector of maps) to solr using opened 'client'. Docs uploaded in pending status, do not auto commit unless mentioned in settings. Returns decoded response of service.

Usage:

(add! client-config {:id "1" :title "title 1"}) (add! client-config [{:id "1" :title "title 1"} {:id "2" :title "title 2"}]) (add! client-config [{:id "1" :title "title 1"} {:id "2" :title "title 2"}] {:commit true})

Settings:

:commit <bool>, default true The :commit operation writes all documents loaded since the last commit to one or more segment files on the disk. Before a commit has been issued, newly indexed content is not visible to searches. The commit operation opens a new searcher, and triggers any event listeners that have been configured. Commits may be triggered from <autocommit> parameters in solrconfig.xml.

:commitWithin <int> Add the document within the specified number of milliseconds.

:optimize <bool> The :optimize operation requests Solr to merge internal data structures in order to improve search performance. For a large index, optimization will take some time to complete, but by merging many small segment files into a larger one, search performance will improve. If you are using Solr’s replication mechanism to distribute searches across many systems, be aware that after an optimize, a complete index will need to be transferred. In contrast, post-commit transfers are usually much smaller.

:overwrite <bool>, default: true Indicates if the unique key constraints should be checked to overwrite previous versions of the same document (see below).

Uploads 'doc-or-docs' (map or vector of maps) to solr using opened 'client'.
Docs uploaded in pending status, do not auto commit unless mentioned in settings.
Returns decoded response of service.

Usage:

(add! client-config {:id "1"  :title "title 1"})
(add! client-config [{:id "1" :title "title 1"}
                     {:id "2" :title "title 2"}])
(add!
 client-config
 [{:id "1" :title "title 1"}
  {:id "2" :title "title 2"}]
 {:commit true})

Settings:

:commit <bool>, default true
The :commit operation writes all documents loaded since the last commit to
one or more segment files on the disk. Before a commit has been issued,
newly indexed content is not visible to searches. The commit operation opens
a new searcher, and triggers any event listeners that have been configured.
Commits may be triggered from <autocommit> parameters in solrconfig.xml.

:commitWithin <int>
Add the document within the specified number of milliseconds.

:optimize <bool>
The :optimize operation requests Solr to merge internal data structures in
order to improve search performance. For a large index, optimization will
take some time to complete, but by merging many small segment files into
a larger one, search performance will improve. If you are using Solr’s
replication mechanism to distribute searches across many systems, be aware
that after an optimize, a complete index will need to be transferred.
In contrast, post-commit transfers are usually much smaller.

:overwrite <bool>, default: true
Indicates if the unique key constraints should be checked to overwrite
previous versions of the same document (see below).
sourceraw docstring

clear!clj

(clear! client-config & [settings])

Deletes all documents in the index by 'client'. Returns decoded response of solr service. NOTE: needs explicit (commit! client-config) after it

Deletes all documents in the index by 'client'.
Returns decoded response of solr service.
NOTE: needs explicit (commit! client-config) after it
sourceraw docstring

commit!clj

(commit! client-config & [settings])

The :commit operation writes all documents loaded since the last commit to one or more segment files on the disk. Before a commit has been issued, newly indexed content is not visible to searches. The commit operation opens a new searcher, and triggers any event listeners that have been configured. Commits may be triggered from <autocommit> parameters in solrconfig.xml.

Optional Settings:

:waitSearcher <bool>, default: true Blocks until a new searcher is opened and registered as the main query searcher, making the changes visible.

:expungeDeletes <bool>, default: false (commit only) Merges segments that have more than 10% deleted docs, expunging them in the process.

The :commit operation writes all documents loaded since the last commit to
one or more segment files on the disk. Before a commit has been issued,
newly indexed content is not visible to searches. The commit operation opens
a new searcher, and triggers any event listeners that have been configured.
Commits may be triggered from <autocommit> parameters in solrconfig.xml.

Optional Settings:

:waitSearcher <bool>, default: true
Blocks until a new searcher is opened and registered as the main query searcher, making the changes visible.

:expungeDeletes <bool>, default: false
(commit only) Merges segments that have more than 10% deleted docs, expunging them in the process.
sourceraw docstring

delete!clj

(delete! client-config id-ids-or-query-map & [settings])

Usage: (delete! client-config "id1") (delete! client-config ["id2" "id3"]) (delete! client-config {:query ":"}) (delete! client-config ["id2" "id3"] {:commit true})

Usage:
(delete! client-config "id1")
(delete! client-config ["id2" "id3"])
(delete! client-config {:query "*:*"})
(delete! client-config ["id2" "id3"] {:commit true})
sourceraw docstring

optimize!clj

(optimize! client-config bool-or-settings)

The :optimize operation requests Solr to merge internal data structures in order to improve search performance. For a large index, optimization will take some time to complete, but by merging many small segment files into a larger one, search performance will improve. If you are using Solr’s replication mechanism to distribute searches across many systems, be aware that after an optimize, a complete index will need to be transferred. In contrast, post-commit transfers are usually much smaller.

Optional Settings:

:waitSearcher <bool>, default: true Blocks until a new searcher is opened and registered as the main query searcher, making the changes visible.

:maxSegments <int>, default: 1 (optimize only) Merges the segments down to no more than this number of segments.

The :optimize operation requests Solr to merge internal data structures in
order to improve search performance. For a large index, optimization will
take some time to complete, but by merging many small segment files into
a larger one, search performance will improve. If you are using Solr’s
replication mechanism to distribute searches across many systems, be aware
that after an optimize, a complete index will need to be transferred.
In contrast, post-commit transfers are usually much smaller.

Optional Settings:

:waitSearcher <bool>, default: true
Blocks until a new searcher is opened and registered as the main query searcher, making the changes visible.

:maxSegments <int>, default: 1
(optimize only) Merges the segments down to no more than this number of segments.
sourceraw docstring

update!clj

(update! client-config commands & [settings])

Sends JSON Update Command(s). In general, the JSON update syntax supports all of the update commands that the XML update handler supports, through a straightforward mapping. Multiple commands, adding and deleting documents, may be contained in one message.

Usage:

(update! client-config {:delete {:id "id1"}})

(update! client-config {:add {:commitWithin 5000, :overwrite false :doc {:f1 "v1" :f2 "v2"}}})

(update! client-config [{:add {:commitWithin 5000 :overwrite false :doc {:f1 "v1 " :f2 "v2 "}}} {:delete {:id "id1 "}}])

Source: https://lucene.apache.org/solr/guide/8_1/uploading-data-with-index-handlers.html#UploadingDatawithIndexHandlers-SendingJSONUpdateCommands

Sends JSON Update Command(s).
In general, the JSON update syntax supports all of the update commands that
the XML update handler supports, through a straightforward mapping. Multiple
commands, adding and deleting documents, may be contained in one message.

Usage:

(update! client-config {:delete {:id "id1"}})

(update! client-config {:add {:commitWithin 5000,
                              :overwrite false
                              :doc {:f1 "v1"
                                    :f2 "v2"}}})


(update! client-config [{:add {:commitWithin 5000
                                        :overwrite false
                                        :doc {:f1 "v1 "
                                              :f2 "v2 "}}}
                                 {:delete {:id "id1 "}}])


Source: https://lucene.apache.org/solr/guide/8_1/uploading-data-with-index-handlers.html#UploadingDatawithIndexHandlers-SendingJSONUpdateCommands
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close