(atomically-update! doc unique-key-field changes)
Atomically update a solr document: doc: document fetched from solr previously, or the id of such a document (must not be a map) unique-key: Name of the attribute that is the document's unique key changes: Vector of maps containing :attribute, :func [one of :set, :inc, :add], and :value. e.g. (atomically-update! doc "cdid" [{:attribute :client :func :set :value "darcy"}])
Atomically update a solr document: doc: document fetched from solr previously, or the id of such a document (must not be a map) unique-key: Name of the attribute that is the document's unique key changes: Vector of maps containing :attribute, :func [one of :set, :inc, :add], and :value. e.g. (atomically-update! doc "cdid" [{:attribute :client :func :set :value "darcy"}])
(extract-facet-ranges query-results facet-date-ranges)
Explicitly pass facet-date-ranges in case one or more ranges are date ranges, and we need to grab a timezone.
Explicitly pass facet-date-ranges in case one or more ranges are date ranges, and we need to grab a timezone.
(extract-facets query-results facet-hier-sep limiting? formatters key-fields)
(more-like-this id
unique-key
similarity-fields
{:keys [match-include? min-doc-freq min-term-freq min-word-len
boost? max-query-terms max-results fields method]
:or {match-include? false
min-doc-freq (int 3)
min-term-freq (int 2)
min-word-len (int 5)
boost? true
max-results (int 5)
fields "score"
max-query-terms (int 1000)}
:as params})
Execute a Solr moreLikeThis (mlt) query.
id: unique id of doc to match.
unique-key: Name of key in schema that corresponds to id.
similarity-fields: Fields to match against. Pass as comma-separated list or vector.
params: Map of optional parameters:
match-include? -- this is not clearly documented. See Solr manual.
min-doc-freq -- ignore words that don't occur in at least this many docs. Default 3.
min-term-freq -- ignore terms that occur fewer times than this in a document. Default 2.
min-word-len -- minimum word length for matching. Default 5.
boost? -- Specifies if query will be boosted by interesting term relevance. Default true.
max-query-terms -- Maximum number of query terms in a search. Default 1000.
max-results -- Maximum number of similar docs returned. Default 5.
fields -- fields of docs to return. Pass as vector or comma-separated list.. Default: unique key + score.
method -- Solr Query method.
Other key/value pairs can be passed in params and are passed onto search*, so can be used
for filtering.
Execute a Solr moreLikeThis (mlt) query. id: unique id of doc to match. unique-key: Name of key in schema that corresponds to id. similarity-fields: Fields to match against. Pass as comma-separated list or vector. params: Map of optional parameters: match-include? -- this is not clearly documented. See Solr manual. min-doc-freq -- ignore words that don't occur in at least this many docs. Default 3. min-term-freq -- ignore terms that occur fewer times than this in a document. Default 2. min-word-len -- minimum word length for matching. Default 5. boost? -- Specifies if query will be boosted by interesting term relevance. Default true. max-query-terms -- Maximum number of query terms in a search. Default 1000. max-results -- Maximum number of similar docs returned. Default 5. fields -- fields of docs to return. Pass as vector or comma-separated list.. Default: unique key + score. method -- Solr Query method. Other key/value pairs can be passed in params and are passed onto search*, so can be used for filtering.
(search q
&
{:keys [method fields facet-fields facet-date-ranges
facet-numeric-ranges facet-queries facet-mincount facet-hier-sep
facet-filters facet-pivot-fields]
:as flags})
Query solr through solrj.
q: Query field
Optional keys:
:method :get or :post (default :get)
:rows Number of rows to return (default is Solr default: 1000)
:start Offset into query result at which to start returning rows (default 0)
:fields Fields to return
:facet-fields Discrete-valued fields to facet. Can be a string, keyword, or map containing
{:name ... :prefix ...}.
:facet-queries Vector of facet queries, each encoded in a string or a map of
{:name, :value, :formatter}. :formatter is optional and defaults to the raw query formatter.
The result is in the :facet-queries response.
:facet-date-ranges Date fields to facet as a vector or maps. Each map contains
:field Field name
:tag Optional, for referencing in a pivot facet
:start Earliest date (as java.util.Date)
:end Latest date (as java.util.Date)
:gap Faceting gap, as String, per Solr (+1HOUR, etc)
:others Comma-separated string: before,after,between,none,all. Optional.
:include Comma-separated string: lower,upper,edge,outer,all. Optional.
:hardend Boolean (See Solr doc). Optional.
:missing Boolean--return empty buckets if true. Optional.
:facet-numeric-ranges Numeric fields to facet, as a vector of maps. Map fields as for
date ranges, but start, end and gap must be numbers.
:facet-mincount Minimum number of docs in a facet for the bucket to be returned.
:facet-hier-sep Useful for path hierarchy token faceting. A regex, such as |.
:facet-filters Solr filter expression on facet values. Passed as a map in the form:
{:name 'facet-name' :value 'facet-value' :formatter (fn [name value] ...) }
where :formatter is optional and is used to format the query.
:facet-pivot-fields Vector of pivots to compute, each a list of facet fields.
If a facet is tagged (e.g., {:tag ts} in :facet-date-ranges)
then the string should be {!range=ts}other-facet. Otherwise,
use comma separated lists: this-facet,other-facet.
:cursor-mark true -- initial cursor; else a previous cursor value from
(:next-cursor-mark (meta result))
Returns the query results as the value of the call, with faceting results as metadata.
Use (meta result) to get facet data.
Query solr through solrj. q: Query field Optional keys: :method :get or :post (default :get) :rows Number of rows to return (default is Solr default: 1000) :start Offset into query result at which to start returning rows (default 0) :fields Fields to return :facet-fields Discrete-valued fields to facet. Can be a string, keyword, or map containing {:name ... :prefix ...}. :facet-queries Vector of facet queries, each encoded in a string or a map of {:name, :value, :formatter}. :formatter is optional and defaults to the raw query formatter. The result is in the :facet-queries response. :facet-date-ranges Date fields to facet as a vector or maps. Each map contains :field Field name :tag Optional, for referencing in a pivot facet :start Earliest date (as java.util.Date) :end Latest date (as java.util.Date) :gap Faceting gap, as String, per Solr (+1HOUR, etc) :others Comma-separated string: before,after,between,none,all. Optional. :include Comma-separated string: lower,upper,edge,outer,all. Optional. :hardend Boolean (See Solr doc). Optional. :missing Boolean--return empty buckets if true. Optional. :facet-numeric-ranges Numeric fields to facet, as a vector of maps. Map fields as for date ranges, but start, end and gap must be numbers. :facet-mincount Minimum number of docs in a facet for the bucket to be returned. :facet-hier-sep Useful for path hierarchy token faceting. A regex, such as \|. :facet-filters Solr filter expression on facet values. Passed as a map in the form: {:name 'facet-name' :value 'facet-value' :formatter (fn [name value] ...) } where :formatter is optional and is used to format the query. :facet-pivot-fields Vector of pivots to compute, each a list of facet fields. If a facet is tagged (e.g., {:tag ts} in :facet-date-ranges) then the string should be {!range=ts}other-facet. Otherwise, use comma separated lists: this-facet,other-facet. :cursor-mark true -- initial cursor; else a previous cursor value from (:next-cursor-mark (meta result)) Returns the query results as the value of the call, with faceting results as metadata. Use (meta result) to get facet data.
(search* q
{:keys [method fields facet-fields facet-date-ranges
facet-numeric-ranges facet-queries facet-mincount
facet-hier-sep facet-filters facet-pivot-fields cursor-mark]
:as flags})
Query solr through solrj.
q: Query field
Optional keys, passed in a map:
:method :get or :post (default :get)
:rows Number of rows to return (default is Solr default: 1000)
:start Offset into query result at which to start returning rows (default 0)
:fields Fields to return
:facet-fields Discrete-valued fields to facet. Can be a string, keyword, or map containing
{:name ... :prefix ...}.
:facet-queries Vector of facet queries, each encoded in a string or a map of
{:name, :value, :formatter}. :formatter is optional and defaults to the raw query formatter.
The result is in the :facet-queries response.
:facet-date-ranges Date fields to facet as a vector or maps. Each map contains
:field Field name
:tag Optional, for referencing in a pivot facet
:start Earliest date (as java.util.Date)
:end Latest date (as java.util.Date)
:gap Faceting gap, as String, per Solr (+1HOUR, etc)
:others Comma-separated string: before,after,between,none,all. Optional.
:include Comma-separated string: lower,upper,edge,outer,all. Optional.
:hardend Boolean (See Solr doc). Optional.
:missing Boolean--return empty buckets if true. Optional.
:facet-numeric-ranges Numeric fields to facet, as a vector of maps. Map fields as for
date ranges, but start, end and gap must be numbers.
:facet-mincount Minimum number of docs in a facet for the bucket to be returned.
:facet-hier-sep Useful for path hierarchy token faceting. A regex, such as |.
:facet-filters Solr filter expression on facet values. Passed as a map in the form:
{:name 'facet-name' :value 'facet-value' :formatter (fn [name value] ...) }
where :formatter is optional and is used to format the query.
:facet-pivot-fields Vector of pivots to compute, each a list of facet fields.
If a facet is tagged (e.g., {:tag ts} in :facet-date-ranges)
then the string should be {!range=ts}other-facet. Otherwise,
use comma separated lists: this-facet,other-facet.
:cursor-mark true -- initial cursor; else a previous cursor value from
(:next-cursor-mark (meta result))
Additional keys can be passed, using Solr parameter names as keywords.
Returns the query results as the value of the call, with faceting results as metadata.
Use (meta result) to get facet data.
Query solr through solrj. q: Query field Optional keys, passed in a map: :method :get or :post (default :get) :rows Number of rows to return (default is Solr default: 1000) :start Offset into query result at which to start returning rows (default 0) :fields Fields to return :facet-fields Discrete-valued fields to facet. Can be a string, keyword, or map containing {:name ... :prefix ...}. :facet-queries Vector of facet queries, each encoded in a string or a map of {:name, :value, :formatter}. :formatter is optional and defaults to the raw query formatter. The result is in the :facet-queries response. :facet-date-ranges Date fields to facet as a vector or maps. Each map contains :field Field name :tag Optional, for referencing in a pivot facet :start Earliest date (as java.util.Date) :end Latest date (as java.util.Date) :gap Faceting gap, as String, per Solr (+1HOUR, etc) :others Comma-separated string: before,after,between,none,all. Optional. :include Comma-separated string: lower,upper,edge,outer,all. Optional. :hardend Boolean (See Solr doc). Optional. :missing Boolean--return empty buckets if true. Optional. :facet-numeric-ranges Numeric fields to facet, as a vector of maps. Map fields as for date ranges, but start, end and gap must be numbers. :facet-mincount Minimum number of docs in a facet for the bucket to be returned. :facet-hier-sep Useful for path hierarchy token faceting. A regex, such as \|. :facet-filters Solr filter expression on facet values. Passed as a map in the form: {:name 'facet-name' :value 'facet-value' :formatter (fn [name value] ...) } where :formatter is optional and is used to format the query. :facet-pivot-fields Vector of pivots to compute, each a list of facet fields. If a facet is tagged (e.g., {:tag ts} in :facet-date-ranges) then the string should be {!range=ts}other-facet. Otherwise, use comma separated lists: this-facet,other-facet. :cursor-mark true -- initial cursor; else a previous cursor value from (:next-cursor-mark (meta result)) Additional keys can be passed, using Solr parameter names as keywords. Returns the query results as the value of the call, with faceting results as metadata. Use (meta result) to get facet data.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close