# How Operator "OR" in repository advanced search works

Alma**Product:**Feb 2018 Release**Product Version:**

##### Description

Below is an explanation of the Boolean mathematics used in our advanced searching, specifically when it come to using the OR operator.

##### Resolution

In Boolean mathematics:

“AND” is Multiplication (*)

“OR” is Plus (+)

Each condition (row) in the advanced search returns ‘0’ or ‘1’ depends on non-match / match.

Boolean mathematics rules:

1 = true

0 = false

1 AND 1 = 1 * 1 = 1

1 AND 0 = 1 * 0 = 0

0 AND 0 = 0 * 0 = 0

1 OR 1 = 1 + 1 = 1

1 OR 0 = 1 + 0 = 1

0 OR 0 = 0 + 0 = 0

So, currently all consecutive ANDs are grouped together similar to the multiplication rule which is calculated before addition (plus) – example:

If we would do the following in the advanced search:

A

**AND**B**AND**C**OR**D**OR**E**OR**F**AND**G**AND**HThis is equivalent to:

A* B * C + D + E + F * G * H

And this will be practically be calculated as:

(A* B * C) + (D) + (E) + (F * G * H)

This is how our advanced search logic is currently working.

If for example you wanted:

A * B * ( C + D + E + F + … )

This can be simplified to:

**( A * B * C ) + ( A * B * D ) + ( A * B * E ) + ( A * B * F ) + ………….**

As follows:

15-Feb-2018**Article last edited:**