Contains Algorithm Implementation Details

Equivalent to ' term* ' - in other words - a trailing wildcard on a term (but no leading wild card) and the term can appear at any position. 

Algorithm:

The contains search has the following characteristics:

Example of use:

The following examples are based on the Automobiles coding scheme.

Example 1:

Search string: automob

Lucene query: +propertyValue:automob* literal_propertyValue:automob^50.0

Result: 1 result


Example 2:
Search string: General Motors

Lucene query: (+propertyValue:general* +propertyValue:motors*) ((+literal_propertyValue:general +literal_propertyValue:motors)^50.0)

Result: 1 result

Associated JUnits:

Junits for contains tests can be found here: https://github.com/lexevs/lexevs/blob/master/lbTest/src/test/java/org/LexGrid/LexBIG/Impl/function/query/lucene/searchAlgorithms/TestContains.java