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 2 Next »

Contents of this Page

 

Literal Substring Implementation Details

The same as the substring search but with special characters enabled.

Algorithm:

The contains search has the following characteristics:

  • This search is case in-sensitive. 
  • It only searches on the literal property value, literal reverse property value.  
  • A leading and trailing wild card is added to the 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 Lucene's StandardAnalyzer.

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

Complete query:

  • +*:* +(entityType:concept)
  • +*:* +isAnonymous:F
  • +*:* +(+literal_propertyValue:*a^s* literal_propertyValue:a^s^50.0) +(propertyType:presentation)

Result: 1 result

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


Example 2:
Search string: a^s sp*cial

Lucene query: +spanNear([mask(spanWildcardQuery(literal_reverse_propertyValue:s^a*)) as propertyValue, mask(spanWildcardQuery(literal_propertyValue:sp*cial*)) as propertyValue], 0, true) ((+literal_propertyValue:a^s +literal_propertyValue:sp*cial)^50.0)

Complete query:

  • +*:* +(entityType:concept)
  • +*:* +isAnonymous:F
  • +*:* +(+spanNear([mask(spanWildcardQuery(literal_reverse_propertyValue:s^a*)) as propertyValue
  • mask(spanWildcardQuery(literal_propertyValue:sp*cial*)) as propertyValue], 0, true) ((+literal_propertyValue:a^s +literal_propertyValue:sp*cial)^50.0)) +(propertyType:presentation)

Result: 1 result

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

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/TestLiteralSubString.java

 

 

  • No labels