ifexist

Purpose

Checks if a certain argument is present in the document. If the argument is present, the results of the second argument are returned.

Syntax

ifexist(argument_1, argument_2[, argument_3])

Arguments

The function accepts two mandatory arguments.

  1. The first argument is the argument whose presence must be checked.

  2. The second argument is the value to return if the argument is present.

  3. The third optional argument is the value to return if the argument is absent.

Returned value

Documents matching the query.

Examples

ifexist(vehicle, street, city) returns "street" in the sentences "Military vehicles and troops in the streets evoked images of Civil War-era Washington" or "city" in the sentence "Will takeover by Gujarat expedite work on Modi’s utopian city?".

ifexist(position(50, entity(Dates, Month:=March, Year:=2022)), entity(Companies)) finds companies only in documents dated March 2022.