Apache Solr Documentation

6.5 Ref Guide (PDF Download)
Solr Tutorial
Solr Community Wiki

Older Versions of this Guide (PDF)

6.6 Draft Ref Guide Topics

Meta-Documentation

This Unreleased Guide Covers Apache Solr 6.6
As of 5 May 2017, committer editing of this Ref Guide is LOCKED for migration to the new Ref Guide. See SOLR-10290 for details.

Skip to end of metadata
Go to start of metadata

 

When new features are added to the "trunk" of Apache Solr, and are not yet backported to the stable branch (ie: "branch_5x"), one of two things should be done from this page...

  1. The feature should be noted here in a new sub-section below. These notes can later be used to flesh out more full documentation in the official Ref Guide once the API/usage of feature has been finalized and merged into the stable branch, or the trunk branch has been forked into a new stable branch (ie: "branch_5x is retired and "trunk" is renamed to "branch_6x")
  2. The feature should be documented in depth in a new child page, using a page name suitable for long term use. As long as the page is a child of this page it will not be included in the official "released" version of the Ref Guide, but once the page is moved to a permanent place in the Ref Guide, any existing links to the page (ie: from "preview" blog posts promoting a feature that is in the works, or from Jira issues where the feature was being developed) will continue to work (because Confluence page URLs do not change if you re-parent a page in the same Space)

Stub Documentation To Flesh Out

Add "sort" to Streaming Expressions for Solr 6.1

sort

The sort function wraps a streaming expression and re-orders the tuples. The sort function emits all incoming tuples in the new sort order. The sort function reads all tuples from the incoming stream, re-orders them using an algorithm with O(nlog(n)) performance characteristics, where n is the total number of tuples in the incoming stream, and then outputs the tuples in the new sort order. Because all tuples are read into memory the memory consumption of this function grows linearly with the number of tuples in the incoming stream.

Parameters

  • StreamExpression
  • by: Sort criteria for re-ordering the tuples

Syntax

The expression below finds dog owners and orders the results by owner and pet name. Notice that it uses an efficient innerJoin by first ordering by the person/owner id and then re-orders the final output by the owner and pet names.

 

Security.json support in Standalone mode

  • SOLR-9481: Authentication and Authorization plugins now work in standalone mode if security.json is placed in SOLR_HOME on every node. Editing config through API is supported but affects only that one node. (janhoy)

Add "evaluators" to Streaming Expressions for Solr 6.5

Evaluators Description

Stream Evaluators can be used to evaluate (calculate) new values based on other values in a tuple. That newly evaluated value can be put into the tuple (as part of a select(...) clause), used to filter streams (as part of a having(...) clause, and for lots of other things. Evaluators can contain field names, raw values, or other evaluators - giving you the ability to create complex evaluation logic, including conditional if/then choices.

In cases where you want to use raw values as part of an evaluation you will need to consider the order of how evaluators are parsed.

  1. If the parameter can be parsed into a valid number than it is considered a number. For example, add(3,4.5)
  2. If the parameter can be parsed into a valid boolean then it is considered a boolean. For example, eq(true,false)
  3. If the parameter can be parsed into a valid evaluator then it is considered an evaluator. For example, eq(add(10,4),add(7,7))
  4. The parameter is considered a field name, even if it quoted. For example, eq(fieldA,"fieldB")

If you wish to use a raw string as part of an evaluation that you will want to consider using the raw(string) evaluator. This will always return the raw value, no matter what is entered.

abs

The abs function will return the absolute value of the provide single parameter. The abs function will fail to execute if the value is non-numeric. If a null value is found then null will be returned as the result.

Parameters

  • Field Name | Raw Number | Number Evaluator

Syntax

The expressions below show the various ways in which you can use the abs evaluator. Only 1 parameter is accepted. Returns a numeric value.

add

The add function will take 2 or more numeric values and add them together. The add function will fail to execute if any of the values are non-numeric. If a null value is found then null will be returned as the result.

Parameters

  • Field Name | Raw Number | Number Evaluator
  • Field Name | Raw Number | Number Evaluator
  • ......
  • Field Name | Raw Number | Number Evaluator

Syntax

The expressions below show the various ways in which you can use the add evaluator. The number and order of these parameters do not matter and is not limited except that at least 2 parameters are required. Returns a numeric value.

and

The and function will return the logical AND of at least 2 boolean parameters. The function will fail to execute if any parameters are non-boolean or null. Returns a boolean value.

Parameters

  • Field Name | Raw Boolean | Boolean Evaluator
  • Field Name | Raw Boolean | Boolean Evaluator
  • ......
  • Field Name | Raw Boolean | Boolean Evaluator

Syntax

The expressions below show the various ways in which you can use the and evaluator. At least 2 parameters are required, but there is no limit to how many you can use

div

The div function will take 2 numeric values and divide them. The function will fail to execute if any of the values are non-numeric or null, or the 2nd value is 0. Returns a numeric value.

Parameters

  • Field Name | Raw Number | Number Evaluator
  • Field Name | Raw Number | Number Evaluator

Syntax

The expressions below show the various ways in which you can use the div evaluator. The first value will be divided by the second and as such the second cannot be 0.

eq

The eq function will return whether all the parameters are equal, as per Java's standard .equals(...) function. The function accepts parameters of any type, but will fail to execute if all the parameters are not of the same type. That is, all are Boolean, all are String, all are Numeric. If any any parameters are null and there is at least one parameter that is not null then false will be returned. Returns a boolean value.

Parameters

  • Field Name | Raw Value | Evaluator
  • Field Name | Raw Value | Evaluator
  • ......
  • Field Name | Raw Value | Evaluator

Syntax

The expressions below show the various ways in which you can use the eq evaluator.

eor

The eor function will return the logical exclusive or of at least 2 boolean parameters. The function will fail to execute if any parameters are non-boolean or null. Returns a boolean value.

Parameters

  • Field Name | Raw Boolean | Boolean Evaluator
  • Field Name | Raw Boolean | Boolean Evaluator
  • ......
  • Field Name | Raw Boolean | Boolean Evaluator

Syntax

The expressions below show the various ways in which you can use the eor evaluator. At least 2 parameters are required, but there is no limit to how many you can use

gteq

The gteq function will return whether the first parameter is greater than or equal to the second parameter. The function accepts numeric and string parameters, but will fail to execute if all the parameters are not of the same type. That is, all are String or all are Numeric. If any any parameters are null then an error will be raised. Returns a boolean value.

Parameters

  • Field Name | Raw Value | Evaluator
  • Field Name | Raw Value | Evaluator

Syntax

The expressions below show the various ways in which you can use the gteq evaluator.

gt

The gt function will return whether the first parameter is greater than the second parameter. The function accepts numeric or string parameters, but will fail to execute if all the parameters are not of the same type. That is, all are String or all are Numeric. If any any parameters are null then an error will be raised. Returns a boolean value.

Parameters

  • Field Name | Raw Value | Evaluator
  • Field Name | Raw Value | Evaluator

Syntax

The expressions below show the various ways in which you can use the gt evaluator.

if

The if function works like a standard conditional if/then statement. If the first parameter is true then the second parameter will be returned else the third parameter will be returned. The function accepts a boolean as the first parameter and anything as the second and third parameters. An error will occur if the first parameter is not a boolean or is null.

Parameters

  • Field Name | Raw Value | Boolean Evaluator
  • Field Name | Raw Value | Evaluator
  • Field Name | Raw Value | Evaluator

Syntax

The expressions below show the various ways in which you can use the if evaluator.

lteq

The lteq function will return whether the first parameter is less than or equal to the second parameter. The function accepts numeric and string parameters, but will fail to execute if all the parameters are not of the same type. That is, all are String or all are Numeric. If any any parameters are null then an error will be raised. Returns a boolean value.

Parameters

  • Field Name | Raw Value | Evaluator
  • Field Name | Raw Value | Evaluator

Syntax

The expressions below show the various ways in which you can use the lteq evaluator.

lt

The lt function will return whether the first parameter is less than the second parameter. The function accepts numeric or string parameters, but will fail to execute if all the parameters are not of the same type. That is, all are String or all are Numeric. If any any parameters are null then an error will be raised. Returns a boolean value.

Parameters

  • Field Name | Raw Value | Evaluator
  • Field Name | Raw Value | Evaluator

Syntax

The expressions below show the various ways in which you can use the gt evaluator.

mult

The mult function will take 2 or more numeric values and multiply them together. The mult function will fail to execute if any of the values are non-numeric. If a null value is found then null will be returned as the result.

Parameters

  • Field Name | Raw Number | Number Evaluator
  • Field Name | Raw Number | Number Evaluator
  • ......
  • Field Name | Raw Number | Number Evaluator

Syntax

The expressions below show the various ways in which you can use the mult evaluator. The number and order of these parameters do not matter and is not limited except that at least 2 parameters are required. Returns a numeric value.

not

The not function will return the logical NOT of a single boolean parameter. The function will fail to execute if the parameter is non-boolean or null. Returns a boolean value.

Parameters

  • Field Name | Raw Boolean | Boolean Evaluator

Syntax

The expressions below show the various ways in which you can use the not evaluator. Only 1 parameter is allowed

or

The or function will return the logical OR of at least 2 boolean parameters. The function will fail to execute if any parameters are non-boolean or null. Returns a boolean value.

Parameters

  • Field Name | Raw Boolean | Boolean Evaluator
  • Field Name | Raw Boolean | Boolean Evaluator
  • ......
  • Field Name | Raw Boolean | Boolean Evaluator

Syntax

The expressions below show the various ways in which you can use the or evaluator. At least 2 parameters are required, but there is no limit to how many you can use

raw

The raw function will return whatever raw value is the parameter. This is useful for cases where you want to use a string as part of another evaluator.

Parameters

  • Raw Value

Syntax

The expressions below show the various ways in which you can use the raw evaluator. Whatever is inside will be returned as-is. Internal evaluators are considered strings and are not evaluated.

sub

The sub function will take 2 or more numeric values and subtract them, from left to right. The sub function will fail to execute if any of the values are non-numeric. If a null value is found then null will be returned as the result.

Parameters

  • Field Name | Raw Number | Number Evaluator
  • Field Name | Raw Number | Number Evaluator
  • ......
  • Field Name | Raw Number | Number Evaluator

Syntax

The expressions below show the various ways in which you can use the sub evaluator. The number of these parameters does not matter and is not limited except that at least 2 parameters are required. Returns a numeric value.

Remove Index-time boost controller from the UI (screenshot)

Update Documents Screen with the screenshot from SOLR-10347

Stub #3

TODO

Child Pages to Promote When Ready

  • No labels