NIH | National Cancer Institute | NCI Wiki  

WIKI MAINTENANCE NOTICE

Please be advised that NCI Wiki will be undergoing maintenance on Thursday, May 23rd between 1200 ET and 1300 ET.
Wiki will remain available, but users may experience screen refreshes or HTTP 502 errors during the maintenance period. If you encounter these errors, wait 1-2 minutes, then refresh your page.

If you have any questions or concerns, please contact the CBIIT Atlassian Management Team.

Error rendering macro 'rw-search'

null

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Current »

Contents of this Page

 

Literal Contains Implementation Details

Works the same as contains but uses the literal property value enabling searches on special characters.

Algorithm:

The Literal Contains search has the following characteristics:

  • This search is case in-sensitive. 
  • It searches on the literal property.  
  • A trailing wild card is added to each token in the search text.
  • The literal property part (without the wild cards) of the query is boosted by 50.  This gives a literal match priority.
  • Parsing is done with the following analyzer:

    • literal_propertyValue - Uses our custom literal analyzer.  This literal analyzer uses Lucene's WhitespaceTokenizer with Lucene's LowerCaseFilter.

     

Example of use:

The following examples are based on the Automobiles coding scheme.

Example 1:

Search string: a^s

Lucene query: +literal_propertyValue:a^s* literal_propertyValue:a\^s^50.0

Result: 1 result

  • entity code: SpecialCharactersConcept
  • entity description: Concept containing special characters

Example 2:

Search string: a^s sp*cial co{nce]pt

Lucene query: +(+literal_propertyValue:a^s* +literal_propertyValue:sp*cial* +literal_propertyValue:co{nce]pt*) ((+literal_propertyValue:a\^s +literal_propertyValue:sp\*cial +literal_propertyValue:co\{nce\]pt)^50.0)

Result: 1 result

  • entity code: SpecialCharactersConcept
  • entity description: Concept containing special characters

Associated JUnits:

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

 

 

  • No labels